[Req-81] Playwright-Selenium Dual-Driver Implementation#670
[Req-81] Playwright-Selenium Dual-Driver Implementation#670nasif-z wants to merge 4 commits intoplaywright-asyncfrom
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7bf65e1a4d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # If runtime parameter is present and valid, update the action subfield | ||
| if browser_driver_runtime_parameter and browser_driver_runtime_parameter.strip().lower() in ("playwright", "selenium"): | ||
| CommonUtil.ExecLog(sModuleInfo, "Runtime parameter for browser driver preference detected", 5) | ||
| updated_action_subfield = browser_driver_runtime_parameter + " action" |
There was a problem hiding this comment.
Normalize routed driver name before building action subfield
The routing check accepts BROWSER_DRIVER case-insensitively, but this assignment uses the raw runtime value, so inputs like Playwright or selenium become Playwright action / selenium action and then fail module resolution in get_module_and_function (which matches module tokens exactly). This makes the new runtime override intermittently break based on capitalization/spacing even though the validation path explicitly treats those values as valid.
Useful? React with 👍 / 👎.
| page = context.pages[0] | ||
|
|
||
| from Framework.Built_In_Automation.Web.Playwright import BuiltInFunctions as PlaywrightBuiltInFunctions | ||
| PlaywrightBuiltInFunctions.current_page = page |
There was a problem hiding this comment.
Populate Playwright globals when attaching to Selenium session
This bridge only sets PlaywrightBuiltInFunctions.current_page, but does not set Playwright's context/browser globals, so actions that depend on context (for example tab/window operations that explicitly fail when context is None) still break after a Selenium-launched attach. That means the new “seamless switching” path is incomplete for a non-trivial subset of Playwright actions.
Useful? React with 👍 / 👎.
| launch_options["args"] = args | ||
|
|
||
| # Add remote debugging port for CDP connection | ||
| all_args = args + ["--remote-debugging-port=9222"] |
There was a problem hiding this comment.
Avoid hard-coding a single CDP port for all browser launches
Using a fixed --remote-debugging-port=9222 for every Playwright launch causes deterministic port collisions when more than one browser instance is opened (for example multiple page_id sessions) or when runs overlap on the same machine, leading to failed launches or attaching to the wrong target. The same constant is also used by the attach path, so this becomes a systemic single-port bottleneck rather than a per-session bridge.
Useful? React with 👍 / 👎.
Runtime Parameter:
BROWSER_DRIVERplaywrightorseleniumselenium action-BROWSER_DRIVERis set toplaywright- all those actions will be converted toplaywright actioninternally by Node at runtimeOptional Parameter:
browser driverThis works similarly to the runtime parameter above but this takes the highest priority when both parameters are in place. This is meant to override the driver preference only for certain actions, allowing the user to have fine-grained driver selection for their steps even when using the runtime parameter to set a global driver preference.
browser driver|optional parameter|playwrightorseleniumselenium action- and if this optional parameter is set toplaywright- the action will be converted toplaywright actioninternally by NodeSeamless driver switching
playwright actionto run on Selenium-launched browsers andselenium actionto run on Playwright-launched browsers