Troubleshooting
Test Timeouts
If you receive a timeout, it could come from the testing framework you are using, or from WebDriver. For example, if you use WebDriverIO with Mocha, there is a default timeout of 10 seconds.
Test Framework Timeouts
Test framework timeouts can be resolved by increasing the timeout option specific to your test framework.
Here are some examples for WebDriverIO, which supports various testing frameworks:
- Mocha
- Jasmine
- Cucumber
WebDriverIO with Mocha Example:
// wdio.conf.js
exports.config = {
framework: 'mocha',
mochaOpts: {
timeout: 90000
},
...
}
WebDriverIO with Jasmine Example:
// wdio.conf.js
exports.config = {
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 90000
},
...
}
WebDriverIO with Cucumber Example:
// wdio.conf.js
exports.config = {
framework: 'mocha',
cucumberOpts: {
timeout: 90000
},
...
}
WebDriver Timeouts
WebDriver timeouts can be increased via the timeouts
capability.
The following WebDriver timeout defaults are used:
capabilities = {
...
timeouts: {
script: 90000,
pageLoad: 300000
}
}
Additional information on WebDriver timeouts can be found here.
Can't Capture Snapshot with cropTo
When using the Snapshot command, if you can't crop the target element with cropTo
and the element isn't scrollable, you can use the scrollAndStitchScreenshot
option. For example:
await browser.execute('/*@visual.snapshot*/', 'Home', { scrollAndStitchScreenshot: true });
Limitations
If the target element is scrollable, the cropTo
option may not capture a complete screenshot.