While trying to run the following FindElements method on a page:
var match = Driver.Instance.FindElements(By.LinkText("Click here"));
I'm receiving the error:
An exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll but was not handled in user code.
OpenQA.Selenium.WebDriverException was unhandled by user code
HResult=-2146233088
Message=The HTTP request to the remote WebDriver server for URL http://localhost:7057/hub/session/a90c4828-3fb3-46d1-923d-8c5cbb65c4fe/elements timed out after 60 seconds.
Source=WebDriver
The link text 'Click here' doesn't actually exist in the page, so I'm not expecting FindElements(By) to actually find anything (I'm using it later on in an If statement). The method is timing out causing the above exception.
From my understanding though, if FindElements times out, and doesn't actually find anything, it should return 0 elements. Not just timeout and throw an exception.
Has anyone else come across this or have any ideas what might be causing it?