Selenium script fails with "Element not displayed" exception

Not reproducible Issue #10760744

Details

Author
Srividhya K.
Created
Feb 1, 2017
Privacy
This issue is public.
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Selenium scripts always fails with “Element not displayed” exception.
I am able to do the following:
-> launch the Edge browser
-> navigate to the URL
-> give the login credentials and click Submit.
-> The login is successful.
But after this operation, no elements are identified by Webdriver.

The sample code used is:

DesiredCapabilities capability = new DesiredCapabilities();
capability = DesiredCapabilities.edge();
if(browser.equals(“edge”))
driver.get("javascript:document.getElementById(‘invalidcert_continue’).click()");

driver.switchTo().frame(“LoginFrame”);
driver.findElement(By.id(“user”)).clear();
driver.findElement(By.id(“user”)).sendKeys(new String[]{username});

driver.findElement(By.id(“user”)).clear();
driver.findElement(By.id(“user”)).sendKeys(new String[]{username});
driver.findElement(By.id(“pass”)).sendKeys(new String[]{password});
driver.findElement(By.id(“loginButton”)).click();

WebDriverWait wait = new WebDriverWait(driver,60);
driver.switchTo().defaultContent();
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(“menu”));
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(“frameset”));
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(“DisplayField”)); /* till this step the code is executed. After this step, Edge browser is unable to find “dispdescObj” */

driver.findElement(By.id(“dispdescObj”)).clear();
driver.findElement(By.id(“dispdescObj”)).sendKeys(new String[]{"test1"});
driver.findElement(By.id(“submit”)).click();
driver.quit();

==========================================================

The same code is working for other browsers like Firefox in the same Windows 10 machine

Sample Error message:

Please find the attached file “Error_thrown_output” refers to output thrown after the execution
“Error_thrown_node” refers to output thrown in the Selenium Node

Attachments

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Brad E.”

    Changed Assigned To from “Brad E.” to “James M.”

    Changed Assigned To to “Mara P.”

    Changed Assigned To from “Mara P.” to “Mustapha J.”

    Changed Title from “Selenium script fails with "Element not displayed" exception” to “Selenium script fails with "Element not displayed" exception”

    Changed Status to “Confirmed”

    Changed Assigned To from “Mustapha J.” to “Clay M.”

  • Hey there,

    Could you please give us the site/markup this is happening on so we can try to debug it locally?

    Thanks,
    Clay

  • Microsoft Edge Team

    Changed Status from “Confirmed” to “Not reproducible”

  • I’m going to close this as not repro for now as we need a page to repro against. Please reactivate the bug and attach sample markup where webdriver is failing and we’ll investigate further.

  • Changed Status from “Not reproducible”

  • Hi Sorry for the dealy. I missed your previous comments.
    Since I am working on a project site which cannot be shared to others, I shall try creating a markup and share the same in about a week.
    Thus, Re-opening the issue

  • Microsoft Edge Team

    Changed Assigned To to “Steven K.”

    Changed Assigned To from “Steven K.” to “Clay M.”

    Changed Status to “Confirmed”

  • Any update on this?

  • Hi!

    I have similar issue - once reaching page https://www.galabingo.com/register, I can’t interact with elements on it (in the example below it is Email field). Could you assist please.

    Setting the driver:

    if(driverName.equalsIgnoreCase(“edge”)){
    log.info(“Create Edge Driver”);
    DesiredCapabilities dc = DesiredCapabilities.edge();
    System.setProperty("webdriver.edge.driver", EdgeWebDriverPath);
    driver = new EdgeDriver(dc);
    }

    The simplified test:

                driver.get("https://www.galabingo.com/register");
                sleep(5000);
                driver.findElement(By.id("email")).click();
    

    The log:

    2017-06-14 10:08:07 INFO - [Starting here the SuccessfulRegistration test] (com.portal.app.AbstractTest(AbstractTest.java:178))
    2017-06-14 10:08:13 INFO - [Test failed (Element not displayed (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 8 milliseconds
    Build info: version: '3.4.0’, revision: 'unknown’, time: ‘unknown’
    System info: host: 'WIN10-2883-1’, ip: '172.26.64.101’, os.name: 'Windows 10’, os.arch: 'amd64’, os.version: '10.0’, java.version: ‘1.8.0_131’
    Driver info: org.openqa.selenium.edge.EdgeDriver
    Capabilities [{applicationCacheEnabled=true, pageLoadStrategy=normal, platform=ANY, acceptSslCerts=true, browserVersion=40.15063.0.0, platformVersion=10, locationContextEnabled=true, webStorageEnabled=true, browserName=MicrosoftEdge, takesScreenshot=true, takesElementScreenshot=true, javascriptEnabled=true, platformName=windows}]
    Session ID: EF421CD0-DCFF-477B-B964-51275E18A43D)] (com.portal.app.TestListener(TestListener.java:46))
    2017-06-14 10:08:13 INFO - [Add screenshot] (com.portal.app.TestListener(TestListener.java:50))
    2017-06-14 10:08:13 INFO - [Directories==>101] (com.portal.app.AbstractTest(AbstractTest.java:465))
    2017-06-14 10:08:13 INFO - [Current directory: reports/Results/Run_97] (com.portal.app.TestListener(TestListener.java:53))
    2017-06-14 10:08:13 INFO - [Screenshot name: 1497424093.png] (com.portal.app.TestListener(TestListener.java:56))
    2017-06-14 10:08:13 INFO - [HTML code:

    ] (com.portal.app.TestListener(TestListener.java:61))

    org.openqa.selenium.ElementNotVisibleException: Element not displayed (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 8 milliseconds
    Build info: version: '3.4.0’, revision: 'unknown’, time: ‘unknown’
    System info: host: 'WIN10-2883-1’, ip: '172.26.64.101’, os.name: 'Windows 10’, os.arch: 'amd64’, os.version: '10.0’, java.version: ‘1.8.0_131’
    Driver info: org.openqa.selenium.edge.EdgeDriver
    Capabilities [{applicationCacheEnabled=true, pageLoadStrategy=normal, platform=ANY, acceptSslCerts=true, browserVersion=40.15063.0.0, platformVersion=10, locationContextEnabled=true, webStorageEnabled=true, browserName=MicrosoftEdge, takesScreenshot=true, takesElementScreenshot=true, javascriptEnabled=true, platformName=windows}]
    Session ID: EF421CD0-DCFF-477B-B964-51275E18A43D

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:671)
    at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:272)
    at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:82)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement$1.invoke(EventFiringWebDriver.java:332)
    at com.sun.proxy.$Proxy23.click(Unknown Source)
    at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.click(EventFiringWebDriver.java:345)
    at com.portal.app.Core.Pages.Registration.registerCore(Registration.java:503)
    at com.portal.app.Bingo.Tests.SuccessfulRegistration.registration(SuccessfulRegistration.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
    at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:200)
    at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:171)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:212)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:707)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    at org.testng.TestNG.run(TestNG.java:1057)
    at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127)
  • Hi,

    I have created the Markup page where the issue is reproducible.
    Please find the attached files.
    When I try to enter “clear” some text in the text box present, or try to click on submit, I get the following error message
    “Element not displayed”

    Please let me know if any further information is required

  • Have attached the following files:

    1. index.html ==> Main file
    2. menu.html ===>Inner first frame
    3. frameset.html ==>Inner second frame
    4. displaypage.html=> Inner final frame
    5. sample.java =====> Sample code
    6. Mark_up_Error_logs.txt==> Error logs
  • Microsoft Edge Team

    Changed Status from “Confirmed” to “Not reproducible”

  • Good news, this is working on our latest builds. It was most likely fixed with some bugs that we fixed regarding how we handled IsDisplayed, I was able to send keys to the element, clear the element, and click the submit button firing the JavaScript alert. The fix should be in the latest insiders release.

You need to sign in to your Microsoft account to add a comment.

Sign in