Question

I am attempting to use Selenium code with F#, I am also using the canopy wrapper. Canopy uses Selenium to make some of it's calls.

My issue is I am struggling to covert Selenium code from Java, C# into an F# format, there doesn't seem to be much help on the internet.

Is anyone able to shed some light on basic conversions. For example in JavaScript the code to get the title of the webpage is

driver.getTitle().then(function(title) {
  console.log('Page title is: ' + title);
}); 

F# doesn't seem to recognize the call 'driver'. Does anyone have any advice or samples they are able to share.

Thanks in advance.

Was it helpful?

Solution

canopy has support for title built in

title() will return the title

http://lefthandedgoat.github.io/canopy/actions.html

The equivalent of driver in canopy is browser, which gives you the current active browser/driver.

To write the same code you have in f# it would be

printfn "Page title is: %s" title()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top