Skip to content

Async Action Support: Convert Node internal functions with async/await#657

Open
nasif-z wants to merge 41 commits into
devfrom
playwright-async
Open

Async Action Support: Convert Node internal functions with async/await#657
nasif-z wants to merge 41 commits into
devfrom
playwright-async

Conversation

@nasif-z
Copy link
Copy Markdown
Collaborator

@nasif-z nasif-z commented Feb 9, 2026

Experimental

This PR is currently meant for experimenting with Playwright Web actions in order to compare its performance with Selenium.

  • Converts several action handling and driver functions from synchronous to async. Thorough testing recommended before merging into dev.
  • Everything runs in the main async event loop, no additional loops are created.
  • All existing synchronous actions continue to work as usual.

Fixed bugs

Fixed a few bugs in the initial Claude-generated code for Playwright web actions, such as:

  • Go to Link action not executing the open browser action automatically in case a browser is not already open
  • Open browser action defaulting to headless mode
  • Partial text match not working in one case

Tested Actions/Functions

  1. Open Browser
  2. Go to Link
  3. Enter Text
  4. Click Element
  5. Locate Element
  6. Wait For Element
  7. Scroll to Element
  8. Save into Variable
  9. If Element Exists [True/False] (Conditional Action)
  10. Switch Iframe
  11. Tear Down Browser

Note

Need to write playwright action in the action name instead of selenium action.

Test Cases used for debugging:

  1. TEST-12438
  2. TEST-12506

@nasif-z nasif-z self-assigned this Feb 9, 2026
@nasif-z nasif-z added bug Something isn't working action-web do-not-merge labels Feb 9, 2026
@nasif-z nasif-z changed the title Playwright Web Actions Async Action Support: Convert Node internal functions with async/await Feb 9, 2026
@sazid
Copy link
Copy Markdown
Member

sazid commented Feb 9, 2026

@claude Review the changes and suggest additional improvements - specially in regards to if something was missed with async/await.

@nasif-z nasif-z removed the bug Something isn't working label Mar 3, 2026
nasif-z and others added 18 commits March 5, 2026 11:57
Similar to Selenium open browser action
…lenium-dual-driver

[Req-81] Playwright-Selenium Dual-Driver Implementation
Add shared browser session utilities for normalized session parsing, safe registry access, session removal, and available CDP port allocation.

Wire Selenium and Playwright actions through a pre-action session activator so actions with an explicit session parameter run against the requested browser instead of whichever global driver was last active. Missing explicit sessions now fail for non-creation actions.

Keep Selenium and Playwright session registries in sync across open, switch, and teardown paths. Store CDP metadata in browser_sessions, clean up paired CDP resources, and preserve non-targeted sessions during framework-specific teardown.

Make Playwright frame state session-aware, fix several Playwright actions that were calling async APIs synchronously, collect browser logs across session Selenium drivers, and make screenshots prefer the active Playwright page when appropriate.

Add focused browser session unit tests for session activation, missing-session failure, and session registry removal.
…ssions

[Task-2247] Named Browser Sessions For Dual-Driver Browser Instances
@Antu7
Copy link
Copy Markdown
Collaborator

Antu7 commented May 19, 2026

🔎 ZeuZ PR Review

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

Overview Value
Agents ❌ 4 failed
Suggestions 💡 0

Agent breakdown

→ General Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe237edae9120ba-IAD, request id: req_efa80c35f80548e287c43404fa21011e

→ Security Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe237ec59458a7d-IAD, request id: req_e7bc6115793a4fb08308fc2592b55220

→ Performance Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe237ec8b4698e4-IAD, request id: req_c03a5dfa02434249a846406619c3c559

→ Testing Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe237edba9a4f8b-IAD, request id: req_93b41cd2376741c29e760b3902d32360

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

@Antu7
Copy link
Copy Markdown
Collaborator

Antu7 commented May 19, 2026

🔎 ZeuZ PR Review

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

Overview Value
Agents ❌ 4 failed
Suggestions 💡 0

Agent breakdown

→ General Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe23ee1a9fbb4ba-IAD, request id: req_afc05401a0a44101bbca1098a863a5c6

→ Security Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe23ee08bdce643-IAD, request id: req_321b63cd3ea946e0b2d173756201b0fd

→ Performance Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe23ee18e0f0829-IAD, request id: req_5468cafca8a544fbaf6aca722e1a4682

→ Testing Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe23edf9a295764-IAD, request id: req_09f2617be49e4ae9bbec7ff96c24349b

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

Run Playwright teardown before Selenium during driver cleanup so Playwright-owned sessions close their async browser resources first.

Teach Selenium global teardown to skip sessions that are owned by Playwright, while still allowing Selenium-owned sessions with Playwright bridges to be cleaned up.

Add a regression test covering Playwright-owned sessions with Selenium CDP bridges so Selenium teardown does not close or remove them.
@Antu7
Copy link
Copy Markdown
Collaborator

Antu7 commented May 19, 2026

🔎 ZeuZ PR Review

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

Overview Value
Agents ⏳ 1 reviewing, ❌ 3 failed
Suggestions 💡 0

Agent breakdown

→ General Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe300c33da5fc33-IAD, request id: req_4280a832f3a648139c8338d9f4f14b9e

→ Security Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe300c2af85ae0c-IAD, request id: req_eae8425f71ba414999888fa90528b84d

→ Performance Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe300c2eafed680-IAD, request id: req_66f0c9e11db44596adc47ad4a20de9b3

→ Testing Review

Status: ⏳ Reviewing
Suggestions: 0 suggestions

Current status: reviewing.

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

Treat index rows in Playwright switch_iframe as iframe/frame indexes instead of generic element attributes. This prevents index iframe parameters from producing invalid selectors such as [index='1'].

Allow a default-content reset and a subsequent iframe target in the same action, matching the Selenium action behavior used by existing test data.

Build indexed frame locators with frame_locator(tag).nth(index), preserve selector-based iframe targets, and save the resulting frame locator back to the active browser session.

Add regression coverage for switching to default content and then selecting iframe index 1 with a Playwright action.
@Antu7
Copy link
Copy Markdown
Collaborator

Antu7 commented May 19, 2026

🔎 ZeuZ PR Review

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

Overview Value
Agents ❌ 4 failed
Suggestions 💡 0

Agent breakdown

→ General Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe37f2eba91576d-IAD, request id: req_6879152d08754483831ae09717478a89

→ Security Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe37f30ae3f37c5-IAD, request id: req_45a7c6c2e9204c72825d483dc6dd0d3b

→ Performance Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe37f3139e6a13a-IAD, request id: req_d084e14d0fd44bed97d05bde335be580

→ Testing Review

Status: ❌ Failed
Suggestions: 0 suggestions

unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe37f2d8f4d1734-IAD, request id: req_1d7e27c585444396b7f5e03c370b0441

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants