CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

How to set desiredCapabilities to accept unsafe scrips?

Open BrunoExterckotter opened this issue 9 years ago • 3 comments

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 avatar Aug 11 '17 15:08 BrunoExterckotter

@BrunoExterckotter Hi! For chrome you should set chromeoptions like this:

 "desiredCapabilities": {
    "chromeOptions": {
             "args": "['ignore-certificate-errors']"
    }
}

Hope it helps!

APshenkin avatar Aug 14 '17 08:08 APshenkin

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"

BrunoExterckotter avatar Aug 14 '17 20:08 BrunoExterckotter

Thanks for the help @APshenkin ! It worked for me that way:

"desiredCapabilities": { "chromeOptions": { "args": ["allow-running-insecure-content"] } }

BrunoExterckotter avatar Aug 14 '17 21:08 BrunoExterckotter