Skip to content

fix: 1129 await element before execute#1131

Merged
wswebcreation merged 2 commits intomainfrom
ws/fix-1129-await-element-before-execute
Apr 4, 2026
Merged

fix: 1129 await element before execute#1131
wswebcreation merged 2 commits intomainfrom
ws/fix-1129-await-element-before-execute

Conversation

@wswebcreation
Copy link
Copy Markdown
Member

Issue:

checkElement/saveElement threw TypeError: element.getBoundingClientRect is not a function when called with an unawaited ChainablePromiseElement, browser.execute() serializes its arguments and cannot handle a pending Promise, so the browser received {} instead of a DOM element

Fix

  • Both the BiDi and WebDriver paths in takeElementScreenshots.ts now await the element once at the top of each function before it reaches browser.execute()
  • ElementScreenshotDataOptions.element type tightened from any to HTMLElement | WebdriverIO.Element | ChainablePromiseElement to make the Promise-or-resolved union explicit

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 4, 2026

🦋 Changeset detected

Latest commit: 3126a75

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@wdio/image-comparison-core Patch
@wdio/visual-service Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wswebcreation wswebcreation added the bug Something isn't working label Apr 4, 2026
@wswebcreation wswebcreation merged commit d5afb54 into main Apr 4, 2026
11 of 14 checks passed
@wswebcreation wswebcreation deleted the ws/fix-1129-await-element-before-execute branch April 4, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant