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

Intermittent failure in /webdriver/tests/get_active_element/get.py #26295

Open
CYBAI opened this issue Apr 24, 2020 · 0 comments
Open

Intermittent failure in /webdriver/tests/get_active_element/get.py #26295

CYBAI opened this issue Apr 24, 2020 · 0 comments
Labels
A-webdriver I-intermittent Problem reproduces intermittently.

Comments

@CYBAI
Copy link
Member

CYBAI commented Apr 24, 2020

  ▶ Unexpected subtest result in /webdriver/tests/get_active_element/get.py:
  │ FAIL [expected PASS] test_success_iframe_content
  │   → AssertionError: Expected element references to describe the same element, but they did not. Actual: `None`. Expected: `None`.
  │ 
  │ session = <Session a7f59fe9-f7d0-470e-b7da-2c08b5edf5d9>
  │ 
  │     def test_success_iframe_content(session):
  │         session.url = inline("<body></body>")
  │         session.execute_script("""
  │             let iframe = document.createElement('iframe');
  │             document.body.appendChild(iframe);
  │             let input = iframe.contentDocument.createElement('input');
  │             iframe.contentDocument.body.appendChild(input);
  │             input.focus();
  │             """)
  │     
  │         response = get_active_element(session)
  │         element = assert_success(response)
  │ >       assert_is_active_element(session, element)
  │ 
  │ element    = {'element-6066-11e4-a52e-4f735466cecf': '14b844f16a7248fba717672c66624148'}
  │ response   = <Responsetatus=200 body={"value": {"element-6066-11e4-a52e-4f735466cecf": "14b844f16a7248fba717672c66624148"}}>
  │ session    = <Session a7f59fe9-f7d0-470e-b7da-2c08b5edf5d9>
  │ 
  │ tests/wpt/web-platform-tests/webdriver/tests/get_active_element/get.py:115: 
  │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  │ tests/wpt/web-platform-tests/webdriver/tests/support/asserts.py:153: in assert_is_active_element
  │     assert_same_element(session, element, from_js)
  │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  │ 
  │ session = <Session a7f59fe9-f7d0-470e-b7da-2c08b5edf5d9>
  │ a = {'element-6066-11e4-a52e-4f735466cecf': '14b844f16a7248fba717672c66624148'}
  │ b = <Element 68e8c3773d8d40cfaa4da2742bf5d53f>
  │ 
  │     def assert_same_element(session, a, b):
  │         """Verify that two element references describe the same element."""
  │         if isinstance(a, dict):
  │             assert Element.identifier in a, "Actual value does not describe an element"
  │             a_id = a[Element.identifier]
  │         elif isinstance(a, Element):
  │             a_id = a.id
  │         else:
  │             raise AssertionError("Actual value is not a dictionary or web element")
  │     
  │         if isinstance(b, dict):
  │             assert Element.identifier in b, "Expected value does not describe an element"
  │             b_id = b[Element.identifier]
  │         elif isinstance(b, Element):
  │             b_id = b.id
  │         else:
  │             raise AssertionError("Expected value is not a dictionary or web element")
  │     
  │         if a_id == b_id:
  │             return
  │     
  │         message = ("Expected element references to describe the same element, " +
  │                    "but they did not.")
  │     
  │         # Attempt to provide more information, accounting for possible errors such
  │         # as stale element references or not visible elements.
  │         try:
  │             a_markup = session.execute_script("return arguments[0].outerHTML;", args=(a,))
  │             b_markup = session.execute_script("return arguments[0].outerHTML;", args=(b,))
  │             message += " Actual: `%s`. Expected: `%s`." % (a_markup, b_markup)
  │         except WebDriverException:
  │             pass
  │     
  │ >       raise AssertionError(message)
  │ E       AssertionError: Expected element references to describe the same element, but they did not. Actual: `None`. Expected: `None`.
  │ 
  │ a          = {'element-6066-11e4-a52e-4f735466cecf': '14b844f16a7248fba717672c66624148'}
  │ a_id       = '14b844f16a7248fba717672c66624148'
  │ a_markup   = None
  │ b          = <Element 68e8c3773d8d40cfaa4da2742bf5d53f>
  │ b_id       = '68e8c3773d8d40cfaa4da2742bf5d53f'
  │ b_markup   = None
  │ message    = 'Expected element references to describe the same element, but they did not. Actual: `None`. Expected: `None`.'
  │ session    = <Session a7f59fe9-f7d0-470e-b7da-2c08b5edf5d9>
  │ 
  └ tests/wpt/web-platform-tests/webdriver/tests/support/asserts.py:189: AssertionError
@CYBAI CYBAI added the I-intermittent Problem reproduces intermittently. label Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-webdriver I-intermittent Problem reproduces intermittently.
Projects
None yet
Development

No branches or pull requests

1 participant