Selenium Chrome 3.5.3警报

时间:2017-10-16 09:27:21

标签: java selenium selenium-chromedriver alerts

关于Selenium 3.5.3和处理警报的问题......

我收到了错误:

org.openqa.selenium.UnhandledAlertException: unexpected alert open

...虽然我设置了这段代码:

...
chromeOptions.addArguments("--user-data-dir=C:\\Selenium\\Conf\\ChromeProfile");
chromeOptions.addArguments("--proxy-server=http://" + webdriverChromeUser + ":" + webdriverChromePassWd + "@" + webdriverChromeProxy);
chromeOptions.addArguments("disable-infobars");

chromCapability.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE);
chromCapability.setCapability(ChromeOptions.CAPABILITY, chromeOptions);

remWebDriver = new org.openqa.selenium.remote.RemoteWebDriver(new URL(hubURL), chromCapability);
...

我希望,它有效,但错误出现了。

0 个答案:

没有答案