To effectively debug issues with your code, consider starting Protractor in a debug mode and setting a breakpoint using browser.debugger()
.
More detailed instructions can be found at Debugging Protractor Tests.
Alternatively, you can access the logs from the chromedriver service, which may provide insight:
[2.389][INFO]: COMMAND FindElement {
"sessionId": "b6707ee92a3261e1dc33a53514490663",
"using": "css selector",
"value": "input"
}
[2.398][INFO]: Waiting for pending navigations...
[2.398][INFO]: Done waiting for pending navigations
[2.398][INFO]: RESPONSE FindElement {
"ELEMENT": "0.3367185448296368-1"
}
You can enable these logs by starting Chrome with the --verbose
and --log-path
arguments:
{
browserName: "chrome",
specs: [
"*.spec.js"
],
chromeOptions: {
args: [
"--verbose",
"--log-path=/path/to/the/log/file"
]
}
}
(not tested)
For Firefox, adjust the settings of the firefox profile to turn on and view the logs using webdriver.log.driver
and webdriver.log.file
.
Additional resources: