关于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);
...
我希望,它有效,但错误出现了。