Bidi browserstack executor http - #152
Merged
Merged
Conversation
…TTP/S in BiDi sessions In BiDi sessions, browser.execute() routes over WebSocket directly to the browser, bypassing BrowserStack's HTTP hub, so browserstack_executor: commands fail silently. Overwrite the execute command in BiDi sessions to route executor-prefixed scripts through executeScript (which always uses HTTP/S), leaving all other scripts untouched. Handles single-browser and multiremote setups. Ported from webdriverio/webdriverio#15216. Co-Authored-By: RohanImmanuel <RohanImmanuel@users.noreply.github.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…http fix(browserstack-service): route browserstack_executor commands via HTTP/S in BiDi sessions
…nstance The try/catch wrapped the whole multiremote forEach, so a getInstance failure on one instance aborted the loop and left every later instance unpatched — a half-patched session indistinguishable in the logs from a fully-failed one. Wrap each instance's resolve-and-patch individually and name the failing instance in the warning. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…or routing Extract the executor-script check into isBrowserstackExecutorScript in util.ts and trim leading whitespace before the prefix match, so a padded browserstack_executor: script is routed over HTTP on BiDi instead of being swallowed by script.callFunction. Kept start-anchored and case-sensitive: this is a rewrite decision, unlike the a11y shouldPatchExecuteScript substring checks which only skip a scan. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… sessions The patch only checked isBidi, so a non-BrowserStack BiDi session had execute overwritten and prefix-matched scripts rerouted to /execute/sync. Add the isBrowserstackSession guard every other executor path in the package uses. Applied per multiremote instance, so a mixed multiremote now patches only the BrowserStack leg. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…HTTP on BiDi executeAsync hits the same isBidi && !isMultiremote gate as execute in webdriverio, so a user calling browser.executeAsync with a browserstack_executor payload had it swallowed by script.callFunction. Mirror the overwrite to executeAsyncScript, which is where the classic path already lands. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rahulpsq
requested review from
AdityaHirapara and
pri-gadhiya
and removed request for
a team
August 17, 2026 17:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this about?
Related Jira task/s
Release (mandatory for every PR — required for the
ready-for-reviewlabel)Version bump: (required — tick exactly one)
Release notes type: (optional)
Release notes (customer-facing): (optional but encouraged)
Release notes (internal): (required — engineer-facing; what actually changed / why)
Checklist
PR Validations
Run Tests: Comment RUN_TESTS to trigger sanity tests.