Member-only story

Protractor debugging

Praveen David Mathew
2 min readDec 12, 2019

--

Using VScode:

Click Debug>Add configuration:

This opens the launch.json, replace program and args with below values:

"program": "<your_path_to_protractor>\\npm\\node_modules\\protractor\\bin\\protractor",            "args": ["${workspaceRoot}/confchrome.js"],

Now add break point:

You can add break point by clicking near to the line you want to inspect:

Now execute the debugger by pressing f5:

Using chrome inspect:

just add the keyword debugger to the tests which you want to inspect:

Run below command:

node --inspect-brk <full_Path>npm\node_modules\protractor\bin\protractor <filePath>/confchrome.js --params.url="https://sdsd"

Now open chrome and type chrome://inspect/#devices

Click inspect and click F8 and click run. The exection stops at ‘debugger’ line and now add manual break points ow goto the file using the tabs and add manual break points.

--

--

Praveen David Mathew
Praveen David Mathew

Written by Praveen David Mathew

An open source advocator/WebdriverIO Projectcommiter/Postman Supernova/Postman-html-extra contributor/Stack overflow sqa moderator/Speaker

No responses yet