You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run npm install in both folders - wdio_v8.34.1 and wdio_v8.35.0
Run test with command npm run wdio in each folder
Compare terminal logs
Relevant log output
> wdio
> wdio run ./wdio.conf.js
Execution of 1 workers started at 2024-03-25T12:48:31.351Z
[0-0] RUNNING in chrome - file:///C:/Users/uSER/Desktop/Fetch_multiple_elements_issue/test/test.e2e.js
DevTools listening on ws://127.0.0.1:53150/devtools/browser/de09977a-ef94-4703-9929-d2d8ed76e4b7
[0-0] Error in"Fetch multiple elements issue.Paragraphs don't exist in DOM.Case 1 - not.toBeDisplayed (Synchronous assignment)" Error: Index out of bounds!$$(.div-holder-2 .paragraph-class) returned only 0 elements.
at async Object.executeCommandBe (file:///C:/Users/uSER/Desktop/Fetch_multiple_elements_issue/wdio_v8.35.0/node_modu
les/expect-webdriverio/lib/utils.js:52:16) at async Object.toBeDisplayed (file:///C:/Users/uSER/Desktop/Fetch_multiple_elements_issue/wdio_v8.35.0/node_modules
/expect-webdriverio/lib/matchers/element/toBeDisplayed.js:9:20) at async Context.<anonymous> (C:\Users\uSER\Desktop\Fetch_multiple_elements_issue\test\test.e2e.js:30:13)
[0-0] FAILED in chrome - file:///C:/Users/uSER/Desktop/Fetch_multiple_elements_issue/test/test.e2e.js
"spec" Reporter:
------------------------------------------------------------------
[chrome123.0.6312.59windows#0-0] Running: chrome (v123.0.6312.59) on windows
[chrome123.0.6312.59windows#0-0] Session ID: a269e353d6fc95f1d78a3dbb6ca62be3
[chrome123.0.6312.59windows#0-0]
[chrome123.0.6312.59windows#0-0] » C:\Users\uSER\Desktop\Fetch_multiple_elements_issue\test\test.e2e.js
[chrome123.0.6312.59windows#0-0] Fetch multiple elements issue
[chrome123.0.6312.59windows#0-0] Paragraphs exist in DOM
[chrome123.0.6312.59windows#0-0] ✓ Case 1 - toBeDisplayed (Synchronous assignment)
[chrome123.0.6312.59windows#0-0] ✓ Case 2 - toBeDisplayed (Asynchronous assignment)
[chrome123.0.6312.59windows#0-0]
[chrome123.0.6312.59windows#0-0] Paragraphs don't exist in DOM
[chrome123.0.6312.59windows#0-0] ✖ Case 1 - not.toBeDisplayed (Synchronous assignment)
[chrome123.0.6312.59windows#0-0] ✓ Case 2 - not.toBeDisplayed (Asynchronous assignment)
[chrome123.0.6312.59windows#0-0]
[chrome123.0.6312.59windows#0-0] 3 passing (10.8s)
[chrome123.0.6312.59windows#0-0] 1 failing
[chrome123.0.6312.59windows#0-0]
[chrome123.0.6312.59windows#0-0] 1) Paragraphs don't exist in DOM Case 1 - not.toBeDisplayed (Synchronous assignment)
[chrome123.0.6312.59windows#0-0] Index out of bounds! $$(.div-holder-2 .paragraph-class) returned only 0 elements. [chrome 123.0.6312.59 windows #0-0] Error: Index out of bounds! $$(.div-holder-2 .paragraph-class) returned only 0 elements. [chrome123.0.6312.59windows#0-0] at async Object.executeCommandBe (file:///C:/Users/uSER/Desktop/Fetch_multiple_elements_issue/wdio_v8.35.0/node_modules/expect-webdriverio/lib/utils.js:52:16) [chrome123.0.6312.59windows#0-0] at async Object.toBeDisplayed (file:///C:/Users/uSER/Desktop/Fetch_multiple_elements_issue/wdio_v8.35.0/node_modules/expect-webdriverio/lib/matchers/element/toBeDisplayed.js:9:20) [chrome123.0.6312.59windows#0-0] at async Context.<anonymous> (C:\Users\uSER\Desktop\Fetch_multiple_elements_issue\test\test.e2e.js:30:13)
SpecFiles: 0passed,1failed,1total (100% completed) in00:00:15
Code of Conduct
I agree to follow this project's Code of Conduct
Is there an existing issue for this?
I have searched the existing issues
The text was updated successfully, but these errors were encountered:
@Nikola-Dz thanks for raising an issue. I recently made some changes around this logic and didn't kept this use case in mind. I will look for a patch for this as it is a valid use case. Thanks for providing a reproducible example.
Have you read the Contributing Guidelines on issues?
WebdriverIO Version
v8.34.1 & v8.35.0
Node.js Version
v20.11.0
Mode
WDIO Testrunner
Which capabilities are you using?
No response
What happened?
Since the release of v8.35.00 - #12530 I'm getting an error if I try to fetch elements which are not displayed or not existing.
The test file contains 4 cases:
Elements exist in DOM
1.1 Case 1 - toBeDisplayed (Synchronous assignment)
1.2 Case 2 - toBeDisplayed (Asynchronous assignment)
Elements don't exist in DOM
2.1 Case 1 - not.toBeDisplayed (Synchronous assignment)
2.2 Case 2 - not.toBeDisplayed (Asynchronous assignment)
In older versions all 4 listed cases work perfectly fine. In v8.35.00, case 2.1 doesn't work and throws this error:
What is your expected behavior?
No response
How to reproduce the bug.
To reproduce the bug:
npm install
in both folders - wdio_v8.34.1 and wdio_v8.35.0npm run wdio
in each folderRelevant log output
Code of Conduct
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: