webdriver icon indicating copy to clipboard operation
webdriver copied to clipboard

Element Click unable to interact with element in <iframe> that is outside viewport

Open andreastt opened this issue 8 years ago • 5 comments

The Element Click command is currently unable to interact with (hit) elements inside <iframe>s that are outside the viewport because it does not bring the <iframe> into view first. This is because Element.scrollIntoView on the element inside the frame only moves the viewport of the frame.

This bug was reported on geckodriver, so see https://github.com/mozilla/geckodriver/issues/1039 for more details.

andreastt avatar Nov 07 '17 22:11 andreastt

I suspect we need to find out if the target web element is inside a frame, then first scroll all of its parent frame elements into view recursively.

andreastt avatar Nov 07 '17 22:11 andreastt

Any guess when this issue will fix?

Gitrrrr avatar Nov 25 '17 11:11 Gitrrrr

Do we need to iteratively move through each viewport, from that closest to the element to the top-level one, attempting to scroll the element into view?

shs96c avatar May 14 '18 11:05 shs96c

If browsers have implemented the browsing contexts spec there would be a browsing context tree, which could be iteratively moved up via the parent browsing context. I think the relevant part of the spec should be https://html.spec.whatwg.org/multipage/browsers.html#windows:browsing-context-10

whimboo avatar Jan 11 '19 19:01 whimboo

@shs96c and @AutomatedTester do you have any feedback to my last comment? Would that be a plausible operation?

whimboo avatar Aug 17 '20 09:08 whimboo