abilities.set('acceptInsecureCerts',true)不会在Firefox 66中隐藏警告

时间:2019-05-03 11:36:07

标签: javascript firefox selenium-webdriver

我使用JS编写并在Firefox中执行以下Selenium自动化操作:

  • 打开一个网站,填写登录数据,然后单击“登录”

成功登录后,页面将重定向到另一个链接。
然后,我收到一条错误代码为SEC_ERROR_UNKNOWN_ISSUER的警告,并且自动化失败: Warning 这是我的代码:

const {Builder, By, Key, until} = require('selenium-webdriver');
const firefox = 'firefox';
const Capabilities = require('selenium-webdriver/lib/capabilities').Capabilities;

let capabilities = Capabilities.firefox();
capabilities.set('acceptInsecureCerts', true);
const firefox = 'firefox';

let driver = new Builder()
    .forBrowser(firefox)
    .withCapabilities(capabilities)
    .build();
driver.get(url).then(startProcess).catch(finishProcess);

async function startProcess(){
 //fillOutUsername()
 //fillOutPassword()
 //clickOnLogin() --> after this I get the warning screen above and can't continue with the automation
}

我以为这行capabilities.set('acceptInsecureCerts', true);会摆脱这些事情,但显然不是,有人知道如何摆脱该警告屏幕吗?

0 个答案:

没有答案