Skip to content

Handle a null window identity when switching windows - #2006

Open
Liz-Lian wants to merge 1 commit into
robotframework:masterfrom
Liz-Lian:fix/missing-window-identity
Open

Liz-Lian wants to merge 1 commit into
robotframework:masterfrom
Liz-Lian:fix/missing-window-identity

Conversation

@Liz-Lian

@Liz-Lian Liz-Lian commented Dec 3, 2026

Copy link
Copy Markdown

Fixes #1964.

Firefox may return a successful WebDriver script response with a JSON null value when navigation interrupts the window identity script. Unpacking it raises TypeError before Switch Window can match an available URL or use its existing timeout.

Treat a null script result as missing window ID and name, as for unavailable JavaScript identity today. Handle, URL, and title matching keep using the existing data; no sleep, timeout change, or blanket exception handler.

Validation:

  • Selector regression fails on unmodified master and passes with this fix.
  • inv utest: 259 passed, 2 skipped. Ruff format/lint and git diff checks passed.
  • python atest/run.py headlessfirefox --nounit --suite Windows: 22 passed on Firefox 159.0 and geckodriver 0.37.1.
  • Robot Switch Window via the real Selenium HTTP client and a loopback WebDriver fixture returning JSON null: unmodified master raises TypeError; patched selects the target URL and returns the previous handle. The intermittent timing itself did not reproduce in the real Firefox run.

AI disclosure: OpenAI Codex assisted with implementation and tests.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch Window sporadically fails with TypeError

1 participant