How to set desiredCapabilities to accept unsafe scrips?
What are you trying to achieve?
I need to run a test, but the browser blocks the execution of unsafe system scripts and the screen does not open.
Provide test source code if related
"WebDriverIO": {
"smartWait": 5000,
"browser": "chrome",
"url": "http://www.google.com.br",
"restart": false,
"keepCookies": true,
"windowSize": "maximize",
"waitForTimeout": 5000,
"desiredCapabilities": {
"ignore-certificate-errors": true
},
"timeouts": {
"script": 60000,
"page load": 10000
}
}
Details
- CodeceptJS version: v1.0.0
- NodeJS Version: v6.11.2
- Operating System: Windows10 64bits
- WebDriverIO 4.8.0
@BrunoExterckotter Hi! For chrome you should set chromeoptions like this:
"desiredCapabilities": {
"chromeOptions": {
"args": "['ignore-certificate-errors']"
}
}
Hope it helps!
Thanks for the help @APshenkin ! I'm getting the follow error: "(node:832) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: unknown error: cannot parse capability: chromeOptions from unknown error: cannot parse args from unknown error: must be a list" Using "selenium-server-standalone-3.4.0.jar"
Thanks for the help @APshenkin ! It worked for me that way:
"desiredCapabilities": { "chromeOptions": { "args": ["allow-running-insecure-content"] } }