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,
}

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)

Commits related to this issue

Most upvoted comments

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:

  • System.NotImplementedException: Driver instance must comply with the W3C specification to support getting timeout values.*

Fixed in Java binding by 3c808f66757076fcbe658fc4f6d5934e1616156a Fixed in server by ce06f68fb81162c4b028c3bcbf85b7a86249fc36