Skip to content

Playwright-Selenium feature parity#698

Open
nasif-z wants to merge 6 commits into
playwright-asyncfrom
playwright-selenium-parity
Open

Playwright-Selenium feature parity#698
nasif-z wants to merge 6 commits into
playwright-asyncfrom
playwright-selenium-parity

Conversation

@nasif-z
Copy link
Copy Markdown
Collaborator

@nasif-z nasif-z commented May 24, 2026

Goal

Bring Playwright web actions closer to Selenium action behavior so existing Selenium-style step data works with Playwright.

Playwright actions changelog

  1. open browser

    • Reads browser choice from existing dependency settings when available.
    • Accepts Selenium-style driver/session aliases.
    • Enables downloads in the Playwright browser context.
  2. go to link

    • Accepts Selenium-style session and driver id aliases.
    • Keeps existing wait, timeout, and resolution handling for Playwright navigation.
  3. go to link v2

    • Adds a Playwright compatibility wrapper for Selenium v2 navigation rows.
    • Maps common v2 settings to the normal Playwright navigation flow.
  4. tear down browser / teardown

    • Accepts legacy driver id style session fields.
    • Keeps Playwright session cleanup aligned with Selenium-style step data.
  5. switch browser

    • Defaults to the default session when no id is provided.
    • Accepts driver id, driverid, driver tag, page id, and session.
  6. click and download

    • Adds a Playwright implementation.
    • Clicks the target element, waits for the download, and saves it to the requested path or download folder.
  7. keystroke keys / keystroke chars

    • Adds Selenium key aliases such as CMD, PLUS, MINUS, and DASH.
    • Adds paste handling that uses clipboard text and dispatches input/change events.
  8. validate full text / validate partial text

    • Uses visible text lines instead of comparing one full text block.
    • Supports Selenium-style ignore case behavior.
  9. save attribute

    • Reads visible text with Playwright inner_text() for closer Selenium parity.
    • Keeps Selenium-style save parameter parsing.
  10. get element info

  • Saves to the variable from the action row when provided.
  • Stores Selenium-shaped size and location data.
  1. get current url
  • Saves the URL to the variable named in the action row.
  • Keeps existing Playwright save parameter support.
  1. scroll
  • Accepts scroll direction from the action row.
  • Supports Selenium-style pixels rows.
  • Scrolls the element when element parameters are provided.
  1. scroll to element / scroll element to top
  • Restores Selenium default additional scroll behavior.
  • Supports direction hints in the additional scroll row name.
  1. select by visible text, select by value, select by index
  • Keeps existing Playwright selection behavior.
  • Improves parsing compatibility with Selenium action rows.
  1. deselect all, deselect by visible text, deselect by value, deselect by index
  • Adds JavaScript-based deselect behavior for Playwright.
  • Fixes deselect all and deselect by index handling.
  1. check uncheck
  • Skips elements that are already in the requested state.
  • Falls back to click or JavaScript click for custom checkbox-like controls.
  1. check uncheck all
  • Adds a Playwright implementation.
  • Finds target elements under a parent and checks or unchecks each one.
  1. slider bar
  • Adds a Playwright implementation.
  • Clicks the slider at the requested percentage position.
  1. close tab
  • Supports Selenium-style tabs lists.
  • Switches to the tab on the left after closing the current tab.
  1. handle alert
  • Supports Selenium shorthand such as get text = var and send text = value.
  • Supports accept/reject aliases.
  • Fails when no alert appears within the timeout.
  1. take screenshot web
  • Uses the configured screenshot folder when no path is provided.
  • Supports action-row filename formats.
  • Saves zeuz_screenshot like Selenium.
  1. execute javascript
  • Supports Selenium-style variable optional parameter.
  • Supports return ... page scripts.
  • Supports $elem replacement for element scripts.
  1. upload file
  • Accepts the file path from the Selenium-style action row.
  • Keeps existing Playwright file path input parameter support.
  1. copy image into browser
  • Adds a Playwright implementation.
  • Copies PNG or SVG images into the browser clipboard when browser clipboard APIs allow it.
  1. resize window
  • Accepts Selenium-style width and height rows as element parameters.
  • Keeps existing Playwright viewport resize behavior.
  1. capture network log
  • Adds a Playwright implementation.
  • Captures request and response metadata and saves filtered results to a variable.
  1. extract table data
  • Saves to the variable named in the action row.
  • Applies Selenium-style row and column filters.
  1. Element locating used by Playwright actions
  • Improves shadow DOM locator behavior.
  • Adds regression coverage for raw XPath, hidden elements, negative indexes, and shadow DOM edge cases.
  1. Tests
  • Adds focused Playwright action parity tests.
  • Extends locator and browser session tests for the updated behavior.

nasif-z and others added 3 commits May 24, 2026 17:14
- Matches Selenium's `Get_Element` behaviour
* new actions added

* clean code added

* test case fixes

* update on previous actions & new action open electron app added

* bug fixes

---------

Co-authored-by: Nazmul Ahsan <nazmulahsan@Nazmuls-MacBook-Pro.local>
Co-authored-by: Nasif <nasifcodes@gmail.com>
@Antu7
Copy link
Copy Markdown
Collaborator

Antu7 commented May 24, 2026

🔎 ZeuZ PR Review

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

Overview Value
Agents ✅ 4 completed
Suggestions 💡 3

Agent breakdown

→ General Review

Status: ✅ Completed
Suggestions: 2 suggestions

The PR mostly adds Selenium-parity helpers, but I found two behavior regressions that could misclick elements and hide real navigation failures.

→ Security Review

Status: ✅ Completed
Suggestions: 0 suggestions

No high-confidence security regressions were introduced by this PR diff; the new Playwright parity features mainly expand automation behavior without adding clear injection, auth, or data-exposure flaws.

→ Performance Review

Status: ✅ Completed
Suggestions: 0 suggestions

No material performance regressions found in the PR diff; the changes are mostly parity and robustness updates, with no clear new N+1, unbounded query, or hot-path complexity issues.

→ Testing Review

Status: ✅ Completed
Suggestions: 1 suggestion

The PR adds several new public Playwright actions and materially changes click/text/existence semantics, but there is no direct test coverage for those paths in the repo.

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

- Add missing Playwright action declarations and implementations

- Align Playwright action parsing with Selenium step data formats

- Improve locator shadow DOM parity and regression coverage

- Add focused Playwright parity tests
@Antu7
Copy link
Copy Markdown
Collaborator

Antu7 commented May 24, 2026

🔎 ZeuZ PR Review

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

Overview Value
Agents ✅ 4 completed
Suggestions 💡 3

Agent breakdown

→ General Review

Status: ✅ Completed
Suggestions: 1 suggestion

I found one critical regression in the new Electron launch path: it uses a private Playwright attribute that will fail at runtime. The rest of the diff is mostly additive and looks directionally consistent.

→ Security Review

Status: ✅ Completed
Suggestions: 0 suggestions

No high-confidence security regressions were introduced in the PR diff. The new Playwright parity features mainly expand automation behavior without exposing clear injection, auth, or secret-handling issues.

→ Performance Review

Status: ✅ Completed
Suggestions: 1 suggestion

Found one meaningful performance issue: the new network-log capture path retains unnecessary request objects and keeps accumulating them in memory for the lifetime of the session.

→ Testing Review

Status: ✅ Completed
Suggestions: 1 suggestion

The PR adds several new Playwright actions and materially changes click/navigation behavior, but the parity test file only covers older helper paths. I added focused regression coverage for the Selenium-compatible navigation wrapper and the JS click fallback, which are the most likely to regress silently.

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

@nasif-z nasif-z marked this pull request as ready for review May 24, 2026 16:50
@nasif-z nasif-z requested review from Muntasib-creator and sazid May 24, 2026 16:50
nasif-z added 2 commits June 3, 2026 16:29
- Add shared browser compatibility hydration before execute-python snippets run
- Lazily bridge Selenium and Playwright sessions using existing CDP attachment paths
- Support top-level await for async Playwright custom code while preserving sync snippets
- Read the running Playwright Chromium version from the CDP version endpoint
- Prefer ZeuZ Chrome-for-Testing cached chromedriver before downloading with webdriver-manager
- Attach Selenium with a matching ChromeDriver to avoid browser-version mismatch failures
@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 💡 5

Agent breakdown

→ General Review

Status: ✅ Completed
Suggestions: 1 suggestion

I found one correctness issue in the click fallback path: the new JavaScript fallback changes semantics for right-click and double-click actions. Otherwise, the PR looks internally consistent from the diff provided.

→ Security Review

Status: ✅ Completed
Suggestions: 0 suggestions

No security regressions found in the PR diff. The new Playwright parity actions mainly expand automation coverage, and I did not see a concrete injection, authz, path traversal, or secret-handling issue introduced by these changes.

→ Performance Review

Status: ✅ Completed
Suggestions: 2 suggestions

Two performance regressions stand out: network logging now retains all captured events in memory until stop, and Selenium/Playwright bridging does extra version probing and driver resolution on the connection path.

→ Testing Review

Status: ✅ Completed
Suggestions: 2 suggestions

The PR adds several new Playwright entry points and changes core execution behavior, but I couldn’t find tests covering the new paths or the async execute_python_code change. That leaves important regression risk around action dispatch, navigation parsing, and async Python execution.

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.

4 participants