I am trying to open a browser with the Selenium::WebDriver::Edge::Driver on Windows. I am able to open the browser but my session immediately crashes with this error:
unknown command: Cannot call non W3C standard command while in W3C mode
(Selenium::WebDriver::Error::UnknownCommandError)
How would I turn off W3C mode in selenium ruby? I have tried to follow the docs here by doing:
webdriver_options = Selenium::WebDriver::Edge::Options.new(opts: {w3c: false})
before instantiating the webdriver. However this does not seem to make a difference - I suspect I am setting the options wrong. Has anyone seen this issue before? Thanks.
If you are using capybara, try this:
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :edge)
end
If you're using Edge Chromium, I think the options are like the Chrome's. You could refer to this thread and add the following code then pass it into the driver:
capabilities = { "edgeOptions" => {'w3c' => false} }
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.