lefthandedgoat / canopy

f# web automation and testing library, built on top of Selenium (friendly to c# also)
http://lefthandedgoat.github.io/canopy/
MIT License
506 stars 115 forks source link

(Question) How to set up desiredCapabilities for our browser? #480

Closed OmanF closed 4 years ago

OmanF commented 4 years ago

What the title says.

I basically got let browserCap = OpenQA.Selenium.Chrome.<what here?> (where the browser doesn't need to be Chrome, of course), but when I put that last dot, IntelliSense does not give me DesiredCapabilities.

If I do let bC = OpenQA.Selenium.Remote... the IntelliSense only gives me ReadOnlyDesiredCapabilities (and besides, I'm running tests on the local machine, not remote).

Specifically, how do I add the capabilities javascriptEnabled and acceptSslCerts?

Thanks in advance.

lefthandedgoat commented 4 years ago

I have never done this, but I think I found how. I dont have a F# project handy, so here is the answer in C#.

            var options = new ChromeOptions();
            options.AddAdditionalCapability(CapabilityType.AcceptSslCertificates, true, true);
            options.AddAdditionalCapability(CapabilityType.IsJavaScriptEnabled, true, true);

Then you can start chromeWithOptions like I linked to in your other ticket.

OmanF commented 4 years ago

Alright. I'll verify it in the next day or so and give an answer.

Thanks! (Keeping open until I verify).

OmanF commented 4 years ago

This are a simple case of adding ChromeOptions the usual way. Easy-peasy. Thanks.