Switch Tab / Close tab playwright debug port bug#709
Conversation
…nd Selenium fallback. Resolve intermittent failures via driver capability lookup, thread-safe async execution
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ✅ Completed The PR mostly improves Playwright-to-Selenium fallback handling, but I found one correctness risk: the new debug-port resolver can silently pick an unrelated driver in multi-session runs, which may target the wrong browser instance. → Security ReviewStatus: ✅ Completed No security issues found in the PR diff. The changes are limited to tab-switching fallback logic and test updates, with no new injection, auth, or secret-handling risk introduced. → Performance ReviewStatus: ✅ Completed No material performance regressions found in this PR. The changes mainly improve robustness around tab switching/fallback behavior without introducing clear N+1, unbounded results, or hot-path complexity issues. → Testing ReviewStatus: ✅ Completed The PR adds useful fallback coverage, but it still misses the core regression path where the new debug-port resolver must extract the Chromium port from driver capabilities rather than
|
PR Type
Bug Fix
PR Checklist
Overview
Playwright-based tab switch and close actions were failing intermittently because the CDP debug port was not always available from selenium_details[current_driver_id], async Playwright code could fail when no event loop was running, and Selenium fallback happened without clear logging. Selenium title-based switching also retried too few times for slow-loading tabs.
The fix adds robust CDP port resolution from driver capabilities and selenium_details, runs Playwright async work in a dedicated thread/event loop, logs explicit warnings when falling back to Selenium, increases Selenium title-switch retries (6 × 2s), and improves success logging with tab titles. For close_tab, Playwright is no longer used when no tab title or tab index is provided — those cases fall back to Selenium with a clear log message.
Test Cases
SS