Yurii Rozhkov
Yurii Rozhkov

Reputation: 117

Selenium tests don't work in IE11

I'm working with automation tests on C# + Selenium WebDriver. I stucked with the problem, tests on IE11 don't work, but work on Firefox, Chrome, IE10.

The problem is in the next part of code:

    try
    {
        (new WebDriverWait(driver, TimeSpan.FromMilliseconds(PAGELOAD_DELAY))).
            Until(driver1 => ((IJavaScriptExecutor)driver).
                ExecuteScript("return document.readyState").Equals("complete"));
    }
    catch (WebDriverTimeoutException ex1) 

Error from VS2015 debugger:

VS2015 debug error

I've tried the next but it didn't help

My test environment:

UPD1

  1. Tried add web-site to "Compatibility view list"
  2. Tried this solution
  3. Tried this solution

no results, the same error

UPD2

I've created simple project to check IE11 driver. Code is next:

    [TestMethod]
    public void TestMethod1()
    {
        IWebDriver driver = new InternetExplorerDriver();
        driver.Navigate().GoToUrl("http://google.com");
        try
        {
            (new WebDriverWait(driver, TimeSpan.FromMilliseconds(10000))).
            Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Name("q")));
        }
        catch (WebDriverTimeoutException ex)
        { }
        driver.FindElement(By.Name("q")).SendKeys("123");
    }

Page with google was opened, but I've got an error during debug:

    Result StackTrace:  
    at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
       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.FindElementByName(String name)
       at OpenQA.Selenium.By.<>c__DisplayClassa.<Name>b__8(ISearchContext context)
       at OpenQA.Selenium.By.FindElement(ISearchContext context)
       at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by)
       at UnitTestProject1.UnitTest1.TestMethod1() in C:\dev\VS2015\Projects\UnitTestProject1\UnitTestProject1\UnitTest1.cs:line 21
    Result Message: 
    Test method UnitTestProject1.UnitTest1.TestMethod1 threw exception: 
    OpenQA.Selenium.NoSuchElementException: Unable to find element with name == q

Is there any possibility to run selenium tests under IE11, or it's driver completely broken?

Configuration from test project:

Upvotes: 1

Views: 1677

Answers (1)

Sujay
Sujay

Reputation: 139

Check the emulation mode of your browser

Microsoft Edge ? IE 11 ?

set it to IE 11 .

Upvotes: 0

Related Questions