Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium - 'ITimeouts.ImplicitlyWait(TimeSpan)' is obsolete

I use the C # project settings implicity:

driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(20));

Everything worked. When I installed the new version of selenium-dotnet-3.1.0 my voice this error:

Warning CS0618 'ITimeouts.ImplicitlyWait(TimeSpan)' is obsolete: 'This method will be removed in a future version. Please set the ImplicitWait property instead.'

How to set the global ImplicitlyWait time?

like image 277
RFE Petr Avatar asked Feb 21 '17 13:02

RFE Petr


2 Answers

I had the same problem. You can use the following code:

driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20);
like image 136
Anton Angelov Avatar answered Sep 21 '22 08:09

Anton Angelov


I use Selenium.WebDriver v3.2.0 package (from NuGet), but I can't use ImplicitlyWait property:

RemoteDriver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), _capabilities);
driver = new EventFiringWebDriver(RemoteDriver);
driver.Manage().Timeouts().ImplicitlyWait = TimeSpan.FromSeconds(defaultTimeOut);

returns: Cannot assign to 'ImplicitlyWait' because it is a 'method group'

But driver.Manage().Timeouts().ImplicitlyWait(defaultTimeOut) works well although shows warning about new usage.

like image 21
Veniamin Lardo Avatar answered Sep 22 '22 08:09

Veniamin Lardo