selenium: Support W3C WebDriver Set Timeouts format
From what I can tell, all Selenium client bindings apart from C# use an incorrect data structure as a body when setting timeout durations:
{
type: "implicit",
ms: 42,
}
- Node.js: https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/lib/webdriver.js#L1469
- Ruby: https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/remote/w3c_bridge.rb#L138
- Java: https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java#L834
- Python: https://github.com/SeleniumHQ/selenium/blob/master/py/selenium/webdriver/remote/webdriver.py#L676
The Set Timeouts command expects a data format like this:
{
implicit: 42,
}
New in W3C WebDriver is that multiple timeout durations can be set at the same time:
{
implicit: 123,
pageLoad: 456,
script: 789,
}
Note that driver implementations will enumerate the own properties of the dictionary, so an unknown field is likely to error. For example, if a client passes {foo: 1, implicit: 2}
, this is considered an error scenario by the driver.
See https://github.com/mozilla/geckodriver/issues/511 filed on geckodriver.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (11 by maintainers)
Links to this issue
Commits related to this issue
- [js] Use the W3C set timeouts format. If this fails, fallback to the legacy format. This commit also updates the API to expose getTimeouts() and setTimeouts() methods off of the Options class. The cu... — committed to SeleniumHQ/selenium by jleyba 7 years ago
- Selenium 3.2.0 has a bug that breaks some of our tests https://github.com/SeleniumHQ/selenium/issues/3607 — committed to Uninett/nav by sigmunau 7 years ago
When I use below code in C#, the test fail and below is the message when evaluating the value of driver.Manage().Timeouts().ImplicitWait with Chrome driver
driver.Manage().Timeouts().ImplicitWait = waitTime;
Message:
Fixed in Java binding by 3c808f66757076fcbe658fc4f6d5934e1616156a Fixed in server by ce06f68fb81162c4b028c3bcbf85b7a86249fc36