testing-library / webdriverio-testing-library

🕷️ Simple and complete WebdriverIO DOM testing utilities that encourage good testing practices.
17 stars 14 forks source link

fix: stale element refetching #15

Closed olivierwilkinson closed 3 years ago

olivierwilkinson commented 3 years ago

When an element is stale WebdriverIO will attempt to refetch it when a command is run on it, such as a click.

Since WebElement JSONs are used directly to create the WebdriverIO elements they do not have a selector which is used to attempt to refetch them.

Custom locator strategies are able to add a selector to the resulting element but still fail to refetch and cause problems with within for unknown reasons. In future this may be a viable solution but not currently.

Use SimmerJS to generate a unique selector for the element and send that back from the browser, then use the selector as a string selector for $.

Using SimmerJS has the negative that much more text is being sent between the browser and WebdriverIO.

github-actions[bot] commented 3 years ago

:tada: This PR is included in version 2.1.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: