question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WDIO freezes VS Code debugger upon use of WDIO commands

See original GitHub issue

I’m able to use VS Code debugger but with no ability to use WDIO commands. Any use of WDIO apis such as browser.$()… freezes VS Code debugger.

Here is my launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "WDIO",
            "program": "${workspaceFolder}/node_modules/.bin/wdio",
            "port": 5859,
            "autoAttachChildProcesses": true,
            "protocol": "inspector",
            "args": [
                "wdio.conf.js",
                "--spec",
                "spec/login/login-spec.js" // File which you would like to debug
            ],
            "internalConsoleOptions": "openOnSessionStart",
            "cwd": "${workspaceRoot}",
            "env": {
                "DEBUG": "1" 
                // use an environment variable to be able
                // to toggle debug mode on and off
            }
        }
    ]
}

wdio.conf.js inludes following:

debug: true,
execArgv: ['--inspect-brk=127.0.0.1:5859'],

Is there a way to set up VS Code to be able to use all WDIO apis? Just like we would use browser.debug()

Environment:

  • WebdriverIO version: 5.16.6
  • Node.js version: v12.12.0
  • NPM version: 6.13.0
  • Browser name and version: Chrome
  • Platform name and version: UNIX

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
johnnymo87commented, Apr 7, 2020

Since @christian-bromann closed that PR without merging it, should we open this issue back up @mgrybyk ?

1reaction
christian-bromanncommented, Apr 7, 2020

Any help on this would be highly appreciated!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging WebdriverIO tests in VSCode - YouTube
Setting breakpoints, stepping through commands and reading variables are simple when debugging WebdriverIO tests in VSCode using node's ...
Read more >
Debugging | WebdriverIO
In many cases, you can use browser.debug() to pause your test and inspect the browser. Your command line interface will also switch into...
Read more >
webdriverio/webdriverio - Gitter
Anyone using vscode debugger to step through your own test code. When code is inside a 'it', it will stop at the breakpoints...
Read more >
webstorm doesn't pause on debug breakpoints webdriverIO
IMPORTANT DETAIL. VSCode is able to stop at specified line using the same node, project, wdio version, js file, and the spec. command...
Read more >
How to debug webdriverio in standalone mode?
I'm going absolutely nuts trying to debug a webdriverio test using Chromedriver. You simply cannot step through the code because webdriverio ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found