Skip to content
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 does not click on multiline links in an iframe #5840

Open
Chraneco opened this Issue Apr 28, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@Chraneco
Copy link

Chraneco commented Apr 28, 2018

Meta -

OS: Windows 10

Selenium Version: 3.11

Browser: Internet Explorer

Browser Version: 11

Expected Behavior -

IE should successfully click on all kinds of links

Actual Behavior -

In some cases, IE driver incorrectly calculates the coordinates of link elements, causing IE to miss the intended click.

Steps to reproduce -

Two conditions must be true for this problem to appear:

  • The link is inside an iframe which is not located at the top left of the page
  • The link must be wrapped to at least two lines to have multiple clientrects.

You can use the following simple HTML to reproduce the problem:

main.html

<html>
<body>
<iframe id="test" src="test.html" style="margin-top:80px;" />
</body>
</html>

test.html

<html>
<body><table style="border:3px solid red"><tr><td><a href="http://google.com" style="border:3px solid red">Test Test Test Test Test Test Test Test Test Test Test Test Test</a></td></tr></table></body>
</html>

Selenium script

driver.Navigate().GoToUrl("http://localhost:8000/main.html");
Thread.Sleep(3500);
driver.SwitchTo().Frame(driver.FindElementById("test"));
driver.FindElementByTagName("a").Click();

The problem is that Element.cpp sets a property called hasAbsolutePositionReadyToReturn with these conditions which later on prevents taking the position of the iframe into account.

@pranav700

This comment has been minimized.

Copy link

pranav700 commented May 2, 2018

I have used this with C# code and found no issues.
Either you can try with
driver.FindElement(By.PartialLinkTest("Test")).Click();

@barancev barancev added the D-IE label May 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.