[Webkit-unassigned] [Bug 183278] New: Automation: stale elements not detected when removed from the DOM

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 2 01:04:05 PST 2018


https://bugs.webkit.org/show_bug.cgi?id=183278

            Bug ID: 183278
           Summary: Automation: stale elements not detected when removed
                    from the DOM
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebDriver
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: cgarcia at igalia.com
                CC: bburg at apple.com, mcatanzaro at igalia.com

We detect stale elements when the page is reloaded because the maps are recreated, but if an element is removed from the DOM for the same document we keep the nodes in the maps. We should clear stale elements before accessing the maps. This causes test imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py::testExpectedConditionStalenessOf to fail.

________________________________________________________________________ testExpectedConditionStalenessOf[WebKitGTK] _________________________________________________________________________

driver = <selenium.webdriver.webkitgtk.webdriver.WebDriver (session="2b612d84-8003-49e2-9fa6-6629e446a25f")>, pages = <conftest.Pages object at 0x7f731a9e8190>

    def testExpectedConditionStalenessOf(driver, pages):
        pages.load('dynamicallyModifiedPage.html')
        element = driver.find_element_by_id('element-to-remove')
        with pytest.raises(TimeoutException):
            WebDriverWait(driver, 0.7).until(EC.staleness_of(element))
        driver.find_element_by_id('buttonDelete').click()
        assert 'element' == element.text
>       WebDriverWait(driver, 0.7).until(EC.staleness_of(element))

driver     = <selenium.webdriver.webkitgtk.webdriver.WebDriver (session="2b612d84-8003-49e2-9fa6-6629e446a25f")>
element    = <selenium.webdriver.remote.webelement.WebElement (session="2b612d84-8003-49e2-9fa6-6629e446a25f", element="node-3C1BAE7B-915C-4AFD-995D-A1A92E529ECC")>
pages      = <conftest.Pages object at 0x7f731a9e8190>

WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.support.wait.WebDriverWait (session="2b612d84-8003-49e2-9fa6-6629e446a25f")>
method = <selenium.webdriver.support.expected_conditions.staleness_of object at 0x7f731a9e8790>, 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:

end_time   = 1519977653.752561
message    = ''
method     = <selenium.webdriver.support.expected_conditions.staleness_of object at 0x7f731a9e8790>
screen     = None
self       = <selenium.webdriver.support.wait.WebDriverWait (session="2b612d84-8003-49e2-9fa6-6629e446a25f")>
stacktrace = None
value      = False

WebDriverTests/imported/selenium/py/selenium/webdriver/support/wait.py:80: TimeoutException

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180302/9a672436/attachment.html>


More information about the webkit-unassigned mailing list