Repository navigation
Closed
Labels
Description
▶ OK /webdriver/tests/classic/close_window/close.py
│ ▶ FAIL [expected PASS] test_element_usage_after_closing_browsing_context
│ │ → webdriver.error.NoSuchElementException: no such element (404)
│ │
│ │ session = <Session 4d3697f3-9507-4276-8cbd-f350b99d3ba4>
│ │ inline = <function inline.<locals>.inline at 0x7f02e3769800>
│ │
│ │ def test_element_usage_after_closing_browsing_context(session, inline):
│ │ session.url = inline("<p id='a'>foo")
│ │ session.find.css("p", all=False)
│ │ first = session.window_handle
│ │
│ │ second = session.new_window(type_hint="tab")
│ │ session.window_handle = second
│ │
│ │ session.url = inline("<p id='b'>other")
│ │ > b = session.find.css("p", all=False)
│ │
│ │ first = 'PainterId: 4, TopLevelBrowsingContext(0,10)'
│ │ inline = <function inline.<locals>.inline at 0x7f02e3769800>
│ │ second = 'PainterId: 4, TopLevelBrowsingContext(0,11)'
│ │ session = <Session 4d3697f3-9507-4276-8cbd-f350b99d3ba4>
│ │
│ │ tests/wpt/tests/webdriver/tests/classic/close_window/close.py:96:
│ │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ tests/wpt/tests/tools/webdriver/webdriver/client.py:416: in css
│ │ elements = self._find_element("css selector", element_selector, all)
│ │ all = False
│ │ element_selector = 'p'
│ │ self = <webdriver.client.Find object at 0x7f02e3709f10>
│ │ tests/wpt/tests/tools/webdriver/webdriver/client.py:422: in _find_element
│ │ return self.session.send_session_command("POST", route, body)
│ │ all = False
│ │ body = {'using': 'css selector', 'value': 'p'}
│ │ route = 'element'
│ │ selector = 'p'
│ │ self = <webdriver.client.Find object at 0x7f02e3709f10>
│ │ strategy = 'css selector'
│ │ tests/wpt/tests/tools/webdriver/webdriver/client.py:652: in send_session_command
│ │ return self.send_command(method, url, body, timeout)
│ │ body = {'using': 'css selector', 'value': 'p'}
│ │ method = 'POST'
│ │ self = <Session 4d3697f3-9507-4276-8cbd-f350b99d3ba4>
│ │ timeout = None
│ │ uri = 'element'
│ │ url = 'session/4d3697f3-9507-4276-8cbd-f350b99d3ba4/element'
│ │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │
│ │ self = <Session 4d3697f3-9507-4276-8cbd-f350b99d3ba4>, method = 'POST'
│ │ url = 'session/4d3697f3-9507-4276-8cbd-f350b99d3ba4/element'
│ │ body = {'using': 'css selector', 'value': 'p'}, timeout = None
│ │
│ │ def send_command(self, method, url, body=None, timeout=None):
│ │ """
│ │ Send a command to the remote end and validate its success.
│ │
│ │ :param method: HTTP method to use in request.
│ │ :param uri: "Command part" of the HTTP request URL,
│ │ e.g. `window/rect`.
│ │ :param body: Optional body of the HTTP request.
│ │
│ │ :return: `None` if the HTTP response body was empty, otherwise
│ │ the `value` field returned after parsing the response
│ │ body as JSON.
│ │
│ │ :raises error.WebDriverException: If the remote end returns
│ │ an error.
│ │ :raises ValueError: If the response body does not contain a
│ │ `value` key.
│ │ """
│ │
│ │ response = self.transport.send(
│ │ method,
│ │ url,
│ │ body,
│ │ encoder=protocol.Encoder,
│ │ decoder=protocol.Decoder,
│ │ session=self,
│ │ timeout=timeout,
│ │ )
│ │
│ │ if response.status != 200:
│ │ err = error.from_response(response)
│ │
│ │ if isinstance(err, error.InvalidSessionIdException):
│ │ # The driver could have already been deleted the session.
│ │ self.session_id = None
│ │
│ │ > raise err
│ │ E webdriver.error.NoSuchElementException: no such element (404)
│ │
│ │ body = {'using': 'css selector', 'value': 'p'}
│ │ err = <NoSuchElementException http_status=404>
│ │ method = 'POST'
│ │ response = <Response status=404 error=<NoSuchElementException http_status=404>>
│ │ self = <Session 4d3697f3-9507-4276-8cbd-f350b99d3ba4>
│ │ timeout = None
│ │ url = 'session/4d3697f3-9507-4276-8cbd-f350b99d3ba4/element'
│ │
└ └ tests/wpt/tests/tools/webdriver/webdriver/client.py:607: NoSuchElementException
Activity
constellation: Report WebDriver navigation status only when nothing e…
yezhizhen commentedon Nov 19, 2026
I think already fixed by #50039