Geckodriver throws -> WebDriverException when element is not found instead of NoSuchElement

35 views
Skip to first unread message

automation

unread,
Dec 5, 2016, 10:07:54 PM12/5/16
to Selenium Users
Meta -
OS:  Windows 10
Browser Version:  geckodriver 0.11.1

Expected Behavior -

Element which was not found should return -> NoSuchElementException

Actual Behavior -

Element which was not found returned - WebDriverException

OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:51897/session timed out after 35 seconds. ---> System.Net.WebException: The operation has timed out
   at
System.Net.HttpWebRequest.GetResponse()
   at
OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
   
--- End of inner exception stack trace ---
   at
OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
   at
OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at
OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
   at
OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary 2 parameters)
   at
OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at
OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at
OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxDriverService service



Steps to reproduce -
var test = WebDriver.FindElement(By.Id("testttete"));

Does anyone know if that was made per requirements?! (To throw WebDriver exception instead of NoSuchElementException)

Ahmet Ozkesek

unread,
Dec 6, 2016, 2:35:45 PM12/6/16
to Selenium Users
Could you show us an example of the code you run caused this error, please?

How do you set timeouts? ImplicitlyWait, PageLoad, Script etc.
Reply all
Reply to author
Forward
0 new messages