Open Bug 1314462 Opened 8 years ago Updated 1 year ago

WebDriver:ElementClick on element in <iframe> that is out of the viewport doesn’t scroll into view the frame

Categories

(Remote Protocol :: Marionette, defect, P2)

Version 3
defect

Tracking

(Not tracked)

People

(Reporter: automatedtester, Unassigned)

References

(Blocks 1 open bug)

Details

A test that causes a modal to appear is failing on travis. This is working on my machines. The difference is the screen size. My thinking is that we are not scrolling to this link, since its in a frame, and when we do the click the click isnt really happening.

From Travis-CI

[gw1] FAILED py/test/selenium/webdriver/common/alerts_tests.py::TestAlerts::testShouldAllowUsersToAcceptAnAlertInAFrame[Marionette] 

______ TestAlerts.testShouldAllowUsersToAcceptAnAlertInAFrame[Marionette] ______

[gw1] linux2 -- Python 2.7.3 /home/travis/build/SeleniumHQ/selenium/.tox/py27-marionette/bin/python2.7

self = <test.selenium.webdriver.common.alerts_tests.TestAlerts object at 0x25e1510>

driver = <selenium.webdriver.firefox.webdriver.WebDriver (session="fa8bc510-27e8-4149-82f4-f50ab10e6507")>

pages = <conftest.Pages object at 0x25e12d0>

    @pytest.mark.xfail_phantomjs(

        reason='https://github.com/detro/ghostdriver/issues/20',

        raises=WebDriverException)

    def testShouldAllowUsersToAcceptAnAlertInAFrame(self, driver, pages):

        pages.load("alerts.html")

        driver.switch_to.frame(driver.find_element(By.NAME, "iframeWithAlert"))

        driver.find_element_by_id("alertInFrame").click()

    

>       alert = self._waitForAlert(driver)

py/test/selenium/webdriver/common/alerts_tests.py:184: 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

py/test/selenium/webdriver/common/alerts_tests.py:368: in _waitForAlert

    return WebDriverWait(driver, 3).until(EC.alert_is_present())

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.support.wait.WebDriverWait (session="fa8bc510-27e8-4149-82f4-f50ab10e6507")>

method = <selenium.webdriver.support.expected_conditions.alert_is_present object at 0x28b1950>

message = ''

    def until(self, method, message=''):

        """Calls the method provided with the driver as an argument until the \

            return value is not False."""

        screen = None

        stacktrace = None

    

        end_time = time.time() + self._timeout

        while True:

            try:

                value = method(self._driver)

                if value:

                    return value

            except self._ignored_exceptions as exc:

                screen = getattr(exc, 'screen', None)

                stacktrace = getattr(exc, 'stacktrace', None)

            time.sleep(self._poll)

            if time.time() > end_time:

                break

>       raise TimeoutException(message, screen, stacktrace)

E       TimeoutException: Message:

.tox/py27-marionette/local/lib/python2.7/site-packages/selenium/webdriver/support/wait.py:80: TimeoutException
Blocks: 1368453
Priority: -- → P3
For reference I have also filed
https://github.com/w3c/webdriver/issues/1141 against the
specification to get click-in-frame specified.
OS: Unspecified → All
Hardware: Unspecified → All
Blocks: webdriver
Priority: P3 → P2
Summary: clicking on link in a frame that is out of the viewport isnt scrolled to → WebDriver:ElementClick on element in <iframe> that is out of the viewport doesn’t scroll into view the frame
Severity: normal → S3
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.