webdriverio: [🐛 Bug]: Element not found doesnt show proper stack trace

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?

[chrome 99.0.4844.51 windows #0-0]
[chrome 99.0.4844.51 windows #0-0] 1 failing (11.5s)
[chrome 99.0.4844.51 windows #0-0]
[chrome 99.0.4844.51 windows #0-0] 1) My Login application should login with valid credentials
[chrome 99.0.4844.51 windows #0-0] Error: Can't call setValue on element with selector "#ddd" because element wasn't found
[chrome 99.0.4844.51 windows #0-0] Error: Can't call setValue on element with selector "#ddd" because element wasn't found

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

[chrome 99.0.4844.51 windows #0-0]
[chrome 99.0.4844.51 windows #0-0] 1 failing (11.5s)
[chrome 99.0.4844.51 windows #0-0]
[chrome 99.0.4844.51 windows #0-0] 1) My Login application should login with valid credentials
[chrome 99.0.4844.51 windows #0-0] Error: Can't call setValue on element with selector "#ddd" because element wasn't found
[chrome 99.0.4844.51 windows #0-0] Error: Can't call setValue on element with selector "#ddd" because element wasn't found

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (20 by maintainers)

Most upvoted comments

@praveendvd I discovered #8129. I don’t think that would be why no stacktraces show for you but maybe it is.

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