Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(e2e): ignore stale element reference errors #5623

Merged
merged 13 commits into from
Mar 28, 2024
Merged

Conversation

lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Mar 25, 2024

No description provided.

@lerouxb
Copy link
Contributor Author

lerouxb commented Mar 25, 2024

ok this is now whackamole:

[2024/03/25 12:49:47.412]   1) compass-e2e-tests__OIDC integration
[2024/03/25 12:49:47.412]        does not save tokens across connections for favorites if asked to do so:
[2024/03/25 12:49:47.412]      stale element reference: stale element reference: stale element not found
[2024/03/25 12:49:47.412]   (Session info: chrome=120.0.6099.291)
[2024/03/25 12:49:47.412]       at getErrorFromResponseBody (file:///data/mci/7f8b98e1053f7423be59864bf15b762c/src/node_modules/webdriver/build/utils.js:195:12)
[2024/03/25 12:49:47.412]       at NodeJSRequest._request (file:///data/mci/7f8b98e1053f7423be59864bf15b762c/src/node_modules/webdriver/build/request/index.js:193:23)
[2024/03/25 12:49:47.412]       at processTicksAndRejections (node:internal/process/task_queues:95:5)
[2024/03/25 12:49:47.412]       at async Element.wrapCommandFn (file:///data/mci/7f8b98e1053f7423be59864bf15b762c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 12:49:47.412]       at async Element.wrapCommandFn (file:///data/mci/7f8b98e1053f7423be59864bf15b762c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 12:49:47.412]       at async Element.elementErrorHandlerCallbackFn (file:///data/mci/7f8b98e1053f7423be59864bf15b762c/src/node_modules/webdriverio/build/middlewares.js:38:28)
[2024/03/25 12:49:47.412]       at async Element.wrapCommandFn (file:///data/mci/7f8b98e1053f7423be59864bf15b762c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 12:49:47.412]       at async Element.wrapCommandFn (file:///data/mci/7f8b98e1053f7423be59864bf15b762c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 12:49:47.412]       at async Element.elementErrorHandlerCallbackFn (file:///data/mci/7f8b98e1053f7423be59864bf15b762c/src/node_modules/webdriverio/build/middlewares.js:38:28)
[2024/03/25 12:49:47.412]       at async Element.wrapCommandFn (file:///data/mci/7f8b98e1053f7423be59864bf15b762c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 12:49:47.412]       at async clickVisible (helpers/commands/click-visible.ts:38:7)
[2024/03/25 12:49:47.412]       at async Browser.wrapCommandFn (file:///data/mci/7f8b98e1053f7423be59864bf15b762c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 12:49:47.412]   via Error: clickVisible
[2024/03/25 12:49:47.412]       at Browser.descriptor.value [as clickVisible] (helpers/compass.ts:322:23)
[2024/03/25 12:49:47.412]       at selectFavorite (helpers/commands/select-favorite.ts:8:17)
[2024/03/25 12:49:47.412]       at Browser.<anonymous> (helpers/compass.ts:189:16)
[2024/03/25 12:49:47.412]       at Browser.descriptor.value [as selectFavorite] (helpers/compass.ts:327:27)
[2024/03/25 12:49:47.412]       at Context.<anonymous> (tests/oidc.test.ts:343:19)
[2024/03/25 12:49:47.412]   via Error: selectFavorite
[2024/03/25 12:49:47.412]       at Browser.descriptor.value [as selectFavorite] (helpers/compass.ts:322:23)
[2024/03/25 12:49:47.412]       at Context.<anonymous> (tests/oidc.test.ts:343:19)

@lerouxb
Copy link
Contributor Author

lerouxb commented Mar 26, 2024

ok so the issue isn't that we're caching a reference to an element. Not for longer than two subsequent awaits in very fast commands. Somehow the element becomes stale immediately?

[2024/03/25 18:19:00.504]   1) compass-e2e-tests__OIDC integration
[2024/03/25 18:19:00.504]        does not save tokens across connections for favorites if asked to do so:
[2024/03/25 18:19:00.504]      stale element reference: stale element reference: stale element not found
[2024/03/25 18:19:00.504]   (Session info: chrome=120.0.6099.291)
[2024/03/25 18:19:00.504]       at getErrorFromResponseBody (file:///data/mci/92ff940a6575c22689ba387d099db41c/src/node_modules/webdriver/build/utils.js:195:12)
[2024/03/25 18:19:00.504]       at NodeJSRequest._request (file:///data/mci/92ff940a6575c22689ba387d099db41c/src/node_modules/webdriver/build/request/index.js:193:23)
[2024/03/25 18:19:00.504]       at processTicksAndRejections (node:internal/process/task_queues:95:5)
[2024/03/25 18:19:00.504]       at async Element.wrapCommandFn (file:///data/mci/92ff940a6575c22689ba387d099db41c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 18:19:00.504]       at async Element.wrapCommandFn (file:///data/mci/92ff940a6575c22689ba387d099db41c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 18:19:00.504]       at async Element.elementErrorHandlerCallbackFn (file:///data/mci/92ff940a6575c22689ba387d099db41c/src/node_modules/webdriverio/build/middlewares.js:38:28)
[2024/03/25 18:19:00.504]       at async Element.wrapCommandFn (file:///data/mci/92ff940a6575c22689ba387d099db41c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 18:19:00.504]       at async Element.wrapCommandFn (file:///data/mci/92ff940a6575c22689ba387d099db41c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 18:19:00.504]       at async Element.elementErrorHandlerCallbackFn (file:///data/mci/92ff940a6575c22689ba387d099db41c/src/node_modules/webdriverio/build/middlewares.js:38:28)
[2024/03/25 18:19:00.504]       at async Element.wrapCommandFn (file:///data/mci/92ff940a6575c22689ba387d099db41c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 18:19:00.504]       at async clickVisible (helpers/commands/click-visible.ts:35:7)
[2024/03/25 18:19:00.504]       at async Browser.wrapCommandFn (file:///data/mci/92ff940a6575c22689ba387d099db41c/src/node_modules/@wdio/utils/build/shim.js:88:29)
[2024/03/25 18:19:00.504]   via Error: clickVisible
[2024/03/25 18:19:00.504]       at Browser.descriptor.value [as clickVisible] (helpers/compass.ts:322:23)
[2024/03/25 18:19:00.504]       at selectFavorite (helpers/commands/select-favorite.ts:8:17)
[2024/03/25 18:19:00.504]       at Browser.<anonymous> (helpers/compass.ts:189:16)
[2024/03/25 18:19:00.504]       at Browser.descriptor.value [as selectFavorite] (helpers/compass.ts:327:27)
[2024/03/25 18:19:00.504]       at Context.<anonymous> (tests/oidc.test.ts:343:19)
[2024/03/25 18:19:00.504]   via Error: selectFavorite
[2024/03/25 18:19:00.504]       at Browser.descriptor.value [as selectFavorite] (helpers/compass.ts:322:23)
[2024/03/25 18:19:00.504]       at Context.<anonymous> (tests/oidc.test.ts:343:19)
[2024/03/25 18:19:00.536] 2024-03-25T18:19:00.527Z compass-e2e-tests Removing user d

@lerouxb
Copy link
Contributor Author

lerouxb commented Mar 28, 2024

In this screenshot, this is the moment it tries to click on the "c33b2520-c00d-479c-9ddf-3919981784c8" favourite:
test-packaged-app-70x-enterpriseselecting-favourite-c33b2520-c00d-479c-9ddf-3919981784c8

Then as it tries to see if it is enabled and it can click on it, the element becomes stale.

@lerouxb
Copy link
Contributor Author

lerouxb commented Mar 28, 2024

OK so just not using the same chainable element twice at all seems to work. Gonna go with that just to get this a bit more green.

@lerouxb lerouxb merged commit b6efa5e into main Mar 28, 2024
11 of 13 checks passed
@lerouxb lerouxb deleted the survive-stale-elements branch March 28, 2024 20:24
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.

None yet

4 participants