Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ITimeouts.SetScriptTimeout(TimeSpan) is obsolete - Selenium c#

I used script to handle wait for AngularJS processing, and SetScriptTimeout (as below code) and after update to selenium 3.2.0 , I am getting following warning

ITimeouts.SetScriptTimeout(TimeSpan) is obsolete ........., Please set the AsynchronousJavaScript property instead

driver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromMilliseconds(10)); 

How to solve this warning?

like image 368
Rakesh Avatar asked Jan 05 '23 10:01

Rakesh


1 Answers

SetScriptTimeout(), as well as ImplicitlyWait() and SetPageLoadTimeout() will be removed in future Selenium versions. In the source code you can see it has Obsolete annotation

[Obsolete("This method will be removed in a future version. Please set the AsynchronousJavaScript property instead.")]

Change it to

driver.Manage().Timeouts().AsynchronousJavaScript = TimeSpan.FromMilliseconds(10);
like image 145
Guy Avatar answered Jan 19 '23 00:01

Guy