NodeJs-如何在Selenium Web驱动程序中安装SSL证书

时间:2018-09-04 07:09:12

标签: node.js selenium-webdriver

是否可以使用Node.js在selenium-webdriver中安装SSL证书?

例如,我需要将SSL证书添加到以下代码中:

var webdriver = require('selenium-webdriver'),
    username = "MY-USER",
    accessKey = "MY-KEY",
    driver;

let proxy = require('selenium-webdriver/proxy');

driver = new webdriver.Builder().
  withCapabilities({
    'browserName': 'chrome',
    'platform': 'Windows 10',
    'version': '68',
    'username': username,
    'accessKey': accessKey
  }).
  setProxy(proxy.manual({https: 'host:8000'})).
  usingServer("http://" + username + ":" + accessKey +
              "@ondemand.saucelabs.com:80/wd/hub").
  build();

driver.get("https://www.ford.com");

driver.quit();

0 个答案:

没有答案