Webdriver incorrectly reports elements as not displayed in certain circumstances

Issue #11203904 • Assigned to Mustapha J.


Krzysztof P.
Mar 8, 2017
This issue is public.
Found in
  • Microsoft Edge
Found in build #
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Consider the following HTML:

<div style="overflow-y: hidden">
   <div style="position: fixed" id="hello">Hello!</div>

When opened in Edge, this mark-up renders the string “Hello!” in the upper-left corner of the document. This is presumably correct, and consistent with how other browsers display it.

However, when I execute the following code with selenium-java (v. 2.47.0, also tried 3.2.0) to determine if the inner div is displayed:

RemoteWebDriver driver = new RemoteWebDriver(new URL("http://<my-modern-ie-machine>:4444/wd/hub"), DesiredCapabilities.edge());
WebElement helloElement = driver.findElement(By.id("hello"));
System.out.println(String.format("Hello element is displayed: %s", helloElement.isDisplayed()));

…which results in the following WebDriver commands…

07:16:07.424 INFO - Executing: [new session: Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}]])
07:16:07.455 INFO - Creating a new session for Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}]
[07:16:07.955] - Listening on http://localhost:12592/
07:16:10.409 INFO - Detected dialect: OSS
07:16:10.471 INFO - Done: [new session: Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}]]
07:16:10.565 INFO - Executing: [get: http://<my-server>/index.html])
07:16:10.737 INFO - Done: [get: http://<my-server>/index.html]
07:16:10.769 INFO - Executing: [find element: By.id: hello])
07:16:10.847 INFO - Done: [find element: By.id: hello]
07:16:10.863 INFO - Executing: [is displayed: 0 [[EdgeDriver: MicrosoftEdge on ANY (26FEA7E5-7A38-4CDF-AE85-64DAA4E48176)] -> id: hello]])
07:16:10.893 INFO - Done: [is displayed: 0 [[EdgeDriver: MicrosoftEdge on ANY (26FEA7E5-7A38-4CDF-AE85-64DAA4E48176)] -> id: hello]]
07:16:10.963 INFO - Executing: [close window])
07:16:13.285 INFO - Done: [close window]

Then the result is consistently false, until I remove either overflow-y from the outer div, or position from the inner one.

Since the element remains visible with both of these properties set, I would rather expect WebDriver to return true in this case as well. Some other implementations of WebDriver (namely: IEDriver, FirefoxDriver, and ChromeDriver) work as expected.

For running the tests I use "Microsoft Edge on Win 10 Stable (14.14393)" virtual machine for VirtualBox from modern.ie website. On this machine I use Selenium Standalone Server v. 3.2.0 with Microsoft WebDriver Release 14393.


0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Mara P.”

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

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

    Sign in