Note that there are some explanatory texts on larger screens.

plurals
  1. POSelenium WebDriver FindElement(noSuchElementId) throws TimeoutException instead of NoSuchElementException
    primarykey
    data
    text
    <p>With IE 11 and Selenium 2.37 attempting to get an element text with an invalid elementId:</p> <pre><code>TimeSpan pageLoadTimeout = new TimeSpan(HOURS, MINUTES, m_WebPageSettings.PageLoadTimeoutSeconds); InternetExplorerOptions IeOptions = new InternetExplorerOptions() { InitialBrowserUrl = m_WebPageUrl, IntroduceInstabilityByIgnoringProtectedModeSettings = true, BrowserAttachTimeout = pageLoadTimeout, RequireWindowFocus = true, IgnoreZoomLevel = true }; m_Driver = new InternetExplorerDriver(AppDomain.CurrentDomain.BaseDirectory, IeOptions); m_Driver.Manage().Timeouts().SetPageLoadTimeout(pageLoadTimeout); m_Driver.Manage().Timeouts().SetScriptTimeout(pageLoadTimeout); m_Driver.Manage().Timeouts().ImplicitlyWait(pageLoadTimeout); result = m_Driver.FindElement(By.Id(elementId)).Text; </code></pre> <p>Throws this exception:</p> <pre><code>OpenQA.Selenium.WebDriverException was caught HResult=-2146233088 Message=The HTTP request to the remote WebDriver server for URL http://localhost:56732/session/4d8e064a-90b7-45f2-a7bc-42c7845534a4/element timed out after 60 seconds. Source=WebDriver </code></pre> <p>StackTrace:</p> <pre><code> 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.FindElement(String mechanism, String value) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementById(String id) in at OpenQA.Selenium.By.&lt;&gt;c__DisplayClass2.&lt;Id&gt;b__0(ISearchContext context) at OpenQA.Selenium.By.FindElement(ISearchContext context) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by) at Alpha.Dsm.WebPage.Utilities.WebPageInteractor.GetTableCellString(String cellId) </code></pre> <p>With an inner exception:</p> <pre><code> InnerException: System.Net.WebException HResult=-2146233079 Message=The operation has timed out Source=System StackTrace: at System.Net.HttpWebRequest.GetResponse() at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) </code></pre> <p>Why does it not throw <code>OpenQA.Selenium.NoSuchElementException</code> and how can I get it to?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload