1

I am using Ruby bindings for Webdriver and need to set a particular capability when creating a webdriver instance for IE. The capabilitiy is :ignore_zoom_setting. However, the options I can pass through to the driver are limited to :timeout, :port, :http_client, :introduce_flakiness_by_ignoring_security_domains, and :native_events.

The only way I've found of passing a desired capabilities object is if I use remote webdriver. Can I somehow call Selenium::WebDriver.for :ie and pass in capabilities as well?

Mark

4

1 回答 1

1

哦,是的,你可以。这是应该可以帮助您的代码片段

oops 给出了 java 的代码。我会让它在那里,但对于 ruby​​,你确实需要使用远程

caps = Selenium::WebDriver::Remote::Capabilities.htmlunit(:javascript_enabled => true)
driver = Selenium::WebDriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => caps

对于 Java

DesiredCapabilities cap = new DesiredCapabilities();
cap.setJavascriptEnabled(false);
driver = new InternetExplorerDriver(cap);
于 2012-08-20T20:58:52.717 回答