dahngeek
2/9/2017 - 10:33 PM

Running a PhantomJS driver with webdriver.io using an http proxy. Or with authentication.

Running a PhantomJS driver with webdriver.io using an http proxy. Or with authentication.

capabilities: [
    { browserName: 'phantomjs',
      "phantomjs.page.settings.userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.1.54 (KHTML, like Gecko) Version/9.0 Safari/601.1.54",
      "proxy": {
        "proxyType":"MANUAL",
        "httpProxy":"HOST:PORT"
      }
    }
  ]
  
  
// OTHER OPTIONS WOULD BE:
//  , httpProxy: 'domain.com:port'
//                , sslProxy: 'domain.com:port'
//                , socksUsername: 'username'
//                , socksPassword: '**************'

//OTHER METHOD with AUTH
{ browserName: 'phantomjs',
  "phantomjs.page.settings.userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.1.54 (KHTML, like Gecko) Version/9.0 Safari/601.1.54",
  "phantomjs.cli.args": [
      "--proxy-type=http",
      "--proxy=HOST:PORT",
      "--proxy-auth=username:password"
  ]
}

//Comment if it was useful!