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
[🐛 Bug]: Element not found doesnt show proper stack trace #8108
Comments
@praveendvd I can't reproduce this, even without any reporters I get: npx wdio run ./test/wdio.conf.ts
Execution of 1 workers started at 2022-03-14T08:41:14.382Z
[0-0] RUNNING in chrome - /test/specs/example.e2e.ts
[0-0] Error in "My Login application.should login with valid credentials"
Error: Can't call setValue on element with selector "ddd" because element wasn't found
at implicitWait (/private/tmp/8108/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
at async Element.elementErrorHandlerCallbackFn (/private/tmp/8108/node_modules/webdriverio/build/middlewares.js:20:29)
at async Element.wrapCommandFn (/private/tmp/8108/node_modules/@wdio/utils/build/shim.js:137:29)
[0-0] FAILED in chrome - /test/specs/example.e2e.ts
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:13 How do I need to modify the starter package to reproduce this? |
I am using windows 10 and it happens as it is , I will cross check today @christian-bromann u know where is this error getting handled so that I can look into that also 🎉 |
Check our framework wrapper functions. WebdriverIO doesn't modify the stack traces. |
@christian-bromann i ran in windows and mac , i am gettign same behavior . |
On Ubuntu it is showing the stacktrace for me. This is with a fresh install of latest. I noticed on Christian's example it only shows the stacktrace for wdio files but not the failure line on the example.e2e.ts file which is odd. "spec" Reporter:
------------------------------------------------------------------
[chrome 99.0.4844.74 linux #0-0] Running: chrome (v99.0.4844.74) on linux
[chrome 99.0.4844.74 linux #0-0] Session ID: ce71f3f338878872918f3dcfada89587
[chrome 99.0.4844.74 linux #0-0]
[chrome 99.0.4844.74 linux #0-0] » /test/specs/example.e2e.js
[chrome 99.0.4844.74 linux #0-0] My Login application
[chrome 99.0.4844.74 linux #0-0] ✖ should login with valid credentials
[chrome 99.0.4844.74 linux #0-0]
[chrome 99.0.4844.74 linux #0-0] 1 failing (10.9s)
[chrome 99.0.4844.74 linux #0-0]
[chrome 99.0.4844.74 linux #0-0] 1) My Login application should login with valid credentials
[chrome 99.0.4844.74 linux #0-0] Can't call setValue on element with selector ".fffff" because element wasn't found
[chrome 99.0.4844.74 linux #0-0] Error: Can't call setValue on element with selector ".fffff" because element wasn't found
[chrome 99.0.4844.74 linux #0-0] at implicitWait (/home/will/dev/wdio-stack/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
[chrome 99.0.4844.74 linux #0-0] at async Element.elementErrorHandlerCallbackFn (/home/will/dev/wdio-stack/node_modules/webdriverio/build/middlewares.js:20:29)
[chrome 99.0.4844.74 linux #0-0] at async Element.wrapCommandFn (/home/will/dev/wdio-stack/node_modules/@wdio/utils/build/shim.js:137:29)
[chrome 99.0.4844.74 linux #0-0] at async Context.<anonymous> (/home/will/dev/wdio-stack/test/specs/example.e2e.js:8:9)
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:12 |
@WillBrock fore no stacktrace at all for mac n windows |
Interestingly in TypeScript it's not showing the stack line for the example.e2e.ts file "spec" Reporter:
------------------------------------------------------------------
[chrome 99.0.4844.74 linux #0-0] Running: chrome (v99.0.4844.74) on linux
[chrome 99.0.4844.74 linux #0-0] Session ID: c13a202bfb63b12b4a8edd1e6f17926f
[chrome 99.0.4844.74 linux #0-0]
[chrome 99.0.4844.74 linux #0-0] » /test/specs/example.e2e.ts
[chrome 99.0.4844.74 linux #0-0] My Login application
[chrome 99.0.4844.74 linux #0-0] ✖ should login with valid credentials
[chrome 99.0.4844.74 linux #0-0]
[chrome 99.0.4844.74 linux #0-0] 1 failing (11s)
[chrome 99.0.4844.74 linux #0-0]
[chrome 99.0.4844.74 linux #0-0] 1) My Login application should login with valid credentials
[chrome 99.0.4844.74 linux #0-0] Can't call setValue on element with selector ".adfsadfs" because element wasn't found
[chrome 99.0.4844.74 linux #0-0] Error: Can't call setValue on element with selector ".adfsadfs" because element wasn't found
[chrome 99.0.4844.74 linux #0-0] at implicitWait (/home/will/dev/wdio-st/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
[chrome 99.0.4844.74 linux #0-0] at async Element.elementErrorHandlerCallbackFn (/home/will/dev/wdio-st/node_modules/webdriverio/build/middlewares.js:20:29)
[chrome 99.0.4844.74 linux #0-0] at async Element.wrapCommandFn (/home/will/dev/wdio-st/node_modules/@wdio/utils/build/shim.js:137:29)
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:13 |
@christian-bromann n @WillBrock ya I am using typescript , n wdio built in ts-node for execution . ( Just run , npm run wdio) |
@praveendvd I discovered #8129. I don't think that would be why no stacktraces show for you but maybe it is. |
Will give it a try |
@WillBrock i get this error when target is es2019 |
@WillBrock but it does fixes the issue (the project runs fine ) |
This is beyond my TypeScript knowledge but WebdriverIO is defined in wdio-types/index.d.ts and webdriverio/async.d.ts. It looks like when |
See #8166 .. we should move away from namespaces towards type imports. Is there any chance we can reproduce this for others? Or is this a Windows specific issue? |
@christian-bromann you mean the type issue or the stack trace issue? Stack trace issue is observed in all OS for me . But the type one I tried only in windows |
Is there a way to make it reproducible? Maybe demo repository with GitHub actions? |
@christian-bromann Will try that christian |
@praveendvd how should we proceed with this? Did you have some time to work on a reproducible example? |
@christian-bromann its working now 🥳 |
Have you read the Contributing Guidelines on issues?
WebdriverIO Version
7.17.4
Node.js Version
v16.5.0
Mode
WDIO Testrunner
Which capabilities are you using?
No response
What happened?
in this typescript project it Doesnt throw any stack trace to show where the error was thrown
What is your expected behavior?
Should show line in spec file and pageobject where the error was orginated in
How to reproduce the bug.
package.zip
Relevant log output
Code of Conduct
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: