문제

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.

도움이 되었습니까?

해결책

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()

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top