4

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?

Guy
  • 46,488
  • 10
  • 44
  • 88
Rakesh
  • 91
  • 2
  • 12

1 Answers1

9

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);
Guy
  • 46,488
  • 10
  • 44
  • 88