Closed Bug 1843715 Opened 2 years ago Closed 1 year ago

Intermittent mozilla/tests/webdriver/bidi/session/new/capabilities.py | test_proxy[alwaysMatch] - webdriver.bidi.modules.script.ScriptEvaluateResultException: TypeError: document.querySelector(...) is null

Categories

(Remote Protocol :: WebDriver BiDi, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: intermittent-bug-filer, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: intermittent-failure)

Filed by: ncsoregi [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=422758383&repo=try
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/QB1_2AtpSBG7al5145SzYQ/runs/0/artifacts/public/logs/live_backing.log


[task 2023-07-15T15:19:45.009Z] 15:19:45     INFO - TEST-PASS | /_mozilla/webdriver/bidi/session/new/capabilities.py | test_platform_name[firstMatch] 
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO - TEST-UNEXPECTED-FAIL | /_mozilla/webdriver/bidi/session/new/capabilities.py | test_proxy[alwaysMatch] - webdriver.bidi.modules.script.ScriptEvaluateResultException: TypeError: document.querySelector(...) is null
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO - new_session = <function new_session.<locals>.new_session at 0x000001AD6118E430>
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO - match_capabilities = <function match_capabilities.<locals>.match_capabilities at 0x000001AD612DA280>
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO - server_config = {'aliases': [], 'all_domains': {'': {'': 'web-platform.test', 'nonexistent': 'nonexistent.web-platform.test', 'nonexis...-web-platform.test', 'www1.www2.not-web-platform.test', ...], 'alternate_hosts': {'alt': 'not-web-platform.test'}, ...}
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO - inline = <function inline.<locals>.inline at 0x000001AD612DA940>
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO - match_type = 'alwaysMatch'
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO - 
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -     @pytest.mark.parametrize("match_type", ["alwaysMatch", "firstMatch"])
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -     async def test_proxy(
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -         new_session, match_capabilities, server_config, inline, match_type
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -     ):
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -         domain = server_config["domains"][""][""]
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -         port = server_config["ports"]["http"][0]
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -         proxy_url = f"{domain}:{port}"
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -         proxy_capability = {"proxyType": "manual", "httpProxy": proxy_url}
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -         capabilities = match_capabilities(match_type, "proxy", proxy_capability)
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -     
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -         bidi_session = await new_session(capabilities=capabilities)
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -     
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -         assert bidi_session.capabilities["proxy"] == proxy_capability
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -     
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -         page_content = "proxy"
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -         page_url = inline(f"<div>{page_content}</div>")
[task 2023-07-15T15:19:45.010Z] 15:19:45     INFO -         test_url = page_url.replace(proxy_url, "example.com")
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -     
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -         contexts = await bidi_session.browsing_context.get_tree()
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -     
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -         await bidi_session.browsing_context.navigate(
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -             context=contexts[0]["context"], url=test_url, wait="complete"
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -         )
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -     
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -         # Check that content is expected
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO - >       response = await bidi_session.script.evaluate(
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -             expression="""document.querySelector('div').textContent""",
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -             target=ContextTarget(contexts[0]["context"]),
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -             await_promise=False,
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -         )
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO - 
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x000001AD610E40D0>
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO - capabilities = {'alwaysMatch': {'moz:firefoxOptions': {'args': ['--profile',
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -                                                  'C:\\Users\\task_168942267839156\\AppData\\Local\\Temp\\tmp7ir4pf4w.mozrunner']},
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -                  'proxy': {'httpProxy': 'web-platform.test:8000',
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -                            'proxyType': 'manual'}}}
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO - contexts   = [{'children': [],
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -   'context': '9ad5acf7-032d-47e4-ae97-174744e40811',
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -   'parent': None,
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO -   'url': 'about:blank'}]
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO - domain     = 'web-platform.test'
[task 2023-07-15T15:19:45.011Z] 15:19:45     INFO - inline     = <function inline.<locals>.inline at 0x000001AD612DA940>
[task 2023-07-15T15:19:45.012Z] 15:19:45     INFO - match_capabilities = <function match_capabilities.<locals>.match_capabilities at 0x000001AD612DA280>
[task 2023-07-15T15:19:45.012Z] 15:19:45     INFO - match_type = 'alwaysMatch'
[task 2023-07-15T15:19:45.012Z] 15:19:45     INFO - new_session = <function new_session.<locals>.new_session at 0x000001AD6118E430>

Instead of the target page the browsingContext.navigate command returns when about:blank got loaded. I highly suspect that this is bug 1839138.

Depends on: 1839138
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.