我使用JS编写并在Firefox中执行以下Selenium自动化操作:
成功登录后,页面将重定向到另一个链接。
然后,我收到一条错误代码为SEC_ERROR_UNKNOWN_ISSUER
的警告,并且自动化失败:
这是我的代码:
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);
会摆脱这些事情,但显然不是,有人知道如何摆脱该警告屏幕吗?