-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internet Explorer: Element is not clickable if there is a hidden HTML element with z-index #5668
Comments
Fixed in f13f3f5. Thank you for the report. |
i'm still seeing this not work in selenium 3.12 and IE driver 3.12.0.0 works fine for me in selenium 3.12 and IE driver 3.10.0.0. @eugenedani did the fix work for you? |
@snowymike Using the file provided in the issue report, the problem no longer occurs in IE in 3.12. If you can reproduce with another page, please feel free to supply it. |
working on it, thanks. i've also confirmed that IE 3.12 is ok with the attached HTML file, just not with the UI i'm testing against. working to figure out what's unique in my environment and will post back. |
ok, here's my scenario
html is
|
that example passes in latest chrome driver (2.38) and gecko driver (0.20.1) but not IE driver 3.12, which fails with
|
@snowymike You've encountered a browser bug. There's nothing the IE driver can do about it if the browser returns incorrect information in a call to the JavaScript
When run using Firefox, the following outer HTML is displayed:
When run via IE's console, this is the result:
One could argue that the algorithm in the spec is incorrect, if it doesn't fit all current implementations. One could argue that the browser is incorrect, since the |
ok. is there some process by which these bugs are reported to microsoft? i can certainly stay on 3.10.0.0 for a while, but it seems like unless this browser bug is fixed i'll never be able to update the IE driver again, nor could other selenium testers that need to test with IE and that have apps with similar HTML. any suggestions you have would be appreciated. thanks. |
@snowymike you can try to use or if it does not work you can try JavascriptExecutor |
thanks, i might be able to do that (it did work in this specific scenario). i've already got wrappers around click() for each browser since direct WebElement.click() hasn't always been consistently reliable over time (due to browser, selenium, and driver changes). for firefox and chrome today i do just do WebElement.click(), though for IE i've been doing more than that and actually sending a return key as that worked more reliably for me than click.
switching that to a click using Actions worked in this specific test case.
i'd have to run that change through our suite of hundreds of tests, but that's a possible workaround that would let me upgrade above 3.10.0.0 later. thanks for your help. |
It looks like elementFromPoint returns the correct value, for the given HTML / JS sample. Is it be possible to use elementFromPoint instead of msElementsFromPoint to fix bugs like #5935? |
Meta -
OS: Windows 10
Selenium Version: 3.11.0
Browser: Internet Explorer
Browser Version: 11.909.15063.0 (Update Version: 11.0.51)
IE WebDriver: 3.11.1.1
Expected Behavior -
If there is a hidden element with z-index parameter on a page, visible element will be clicked
Actual Behavior -
there is a hidden element with z-index parameter on a page, clicking on visible element throws exception:
org.openqa.selenium.ElementClickInterceptedException: Element not clickable at point (31,17). Other element would receive the click: <td>
<table style="width: 100%; border-top-color: rgb(233, 246, 255); border-bottom-color: rgb(62, 95, 128); border-left-color: rgb(233, 246, 255); border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-bottom-style: solid; border-left-style: solid;" valign="top">
<tbody><tr>
<td> Login </td>
</tr>
</tbody></table>
</td>
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:15.31Z'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities {acceptInsecureCerts: false, browserName: internet explorer, browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: eager, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), se:ieOptions: {browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersistentHover: true, ie.browserCommandLineSwitches: , ie.ensureCleanSession: false, ie.fileUploadDialogTimeout: 15000, ie.forceCreateProcessApi: false, ignoreProtectedModeSettings: false, ignoreZoomSetting: false, initialBrowserUrl: http://localhost:25911/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: accept}
Session ID: dcf4d1b6-208e-46d2-9fe4-9b8dc7f6f2ae
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.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:279)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83)
at com.polarion.selenium.test.cases.documents.create.DocumentDialogTests.createNewDocumentTest(DocumentDialogTests.java:51)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at java.util.concurrent.Executors$RunnableAdapter.call$$$capture(Executors.java:511)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Steps to reproduce -
HTML code in attachment file
ieWebDriverClickErrorHtmlPage.txt
Selenium code Java:
`InternetExplorerOptions internetExplorerOptions = new InternetExplorerOptions();
internetExplorerOptions.setCapability("applicationCacheEnabled", true);
internetExplorerOptions.waitForUploadDialogUpTo(15, TimeUnit.SECONDS);
internetExplorerOptions.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.ACCEPT).setPageLoadStrategy(PageLoadStrategy.EAGER);
WebDriver webDriver = new InternetExplorerDriver(internetExplorerOptions );
webDriver.get("file:///path/ieWebDriverClickErrorHtmlPage.html");
WebElement element = webDriver.findElement(By.cssSelector("#gLink"));
element.click();`
The text was updated successfully, but these errors were encountered: