Skip to content

Switch Tab / Close tab playwright debug port bug#709

Merged
Muntasib-creator merged 2 commits into
devfrom
task-3113-switch-tab-fallback-bug
Jun 29, 2026
Merged

Switch Tab / Close tab playwright debug port bug#709
Muntasib-creator merged 2 commits into
devfrom
task-3113-switch-tab-fallback-bug

Conversation

@Zayadul-huq-afnan

Copy link
Copy Markdown
Collaborator

PR Type

Bug Fix

PR Checklist

  • [ x ] Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made.
  • Version number has been updated.
  • Required modules have been added to respective "requirements*.txt" files.
  • [ x ] Relevant Test Cases added to this description (below).
  • (Team) Label with affected action categories and semver status.

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

p1 p2

…nd Selenium fallback. Resolve intermittent failures via driver capability lookup, thread-safe async execution
@riz-hossain

Copy link
Copy Markdown
Contributor

🔎 ZeuZ PR Review

Open the full report in ZeuZ: Review findings and apply suggestions

Overview Value
Agents ✅ 4 completed
Suggestions 💡 2

Agent breakdown

→ General Review

Status: ✅ Completed
Suggestions: 1 suggestion

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 Review

Status: ✅ Completed
Suggestions: 0 suggestions

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 Review

Status: ✅ Completed
Suggestions: 0 suggestions

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 Review

Status: ✅ Completed
Suggestions: 1 suggestion

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 selenium_details alone.

Open ZeuZ to inspect full findings, continue an agent conversation, or apply safe patch suggestions.

@Muntasib-creator Muntasib-creator merged commit 6b00158 into dev Jun 29, 2026
7 checks passed
@Muntasib-creator Muntasib-creator deleted the task-3113-switch-tab-fallback-bug branch June 29, 2026 12:19
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.

3 participants