Selenium/How-to/Debug with Visual Studio Code

Environments edit

This tip works if you're targeting:

launch.json edit

The following code is available at gerrit:866436.

Create .vscode/launch.json file.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "run select spec",
            "type": "node",
            "request": "launch",
            "args": ["tests/selenium/wdio.conf.js", "--spec", "${file}"],
            "cwd": "${workspaceFolder}",
            "autoAttachChildProcesses": true,
            "program": "${workspaceRoot}/node_modules/@wdio/cli/bin/wdio.js",
            "console": "integratedTerminal"
        }
    ]
}

Note: This file will work only with WebdriverIO v5 or above.

Make the browser visible edit

To make the browser visible, see Selenium/How-to/Make the browser visible.

Run Selenium tests edit

Open a file in tests/selenium/specs folder in VSCode. Click Run > Start Debugging.

More information edit