Skip to content

Bidi browserstack executor http - #152

Merged
rahulpsq merged 9 commits into
sdk_v9_pre_prodfrom
bidi-browserstack-executor-http
Aug 17, 2026
Merged

Bidi browserstack executor http#152
rahulpsq merged 9 commits into
sdk_v9_pre_prodfrom
bidi-browserstack-executor-http

Conversation

@rahulpsq

Copy link
Copy Markdown
Contributor

What is this about?

Related Jira task/s

Release (mandatory for every PR — required for the ready-for-review label)

Version bump: (required — tick exactly one)

  • minor (backwards-compatible feature)
  • patch (bug fix or other small change)

Release notes type: (optional)

  • New Feature
  • Bug Fix
  • Other Improvement

Release notes (customer-facing): (optional but encouraged)

Release notes (internal): (required — engineer-facing; what actually changed / why)

Checklist

  • Ready to review
  • Has it been tested locally?

PR Validations

Run Tests: Comment RUN_TESTS to trigger sanity tests.

smarkows and others added 9 commits July 31, 2026 20:41
…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
rahulpsq requested a review from a team as a code owner August 17, 2026 17:14
@rahulpsq
rahulpsq requested review from AdityaHirapara and pri-gadhiya and removed request for a team August 17, 2026 17:14
@rahulpsq
rahulpsq merged commit 34bbe0c into sdk_v9_pre_prod Aug 17, 2026
16 of 17 checks passed
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.

4 participants