无法在 InternetExplorerDriver 中添加 cookie。
InternetExplorerDriver driver = .....;
driver.manage().add(myCookie);
异常(exception):
org.openqa.selenium.WebDriverException: Unable to add cookie to page
(WARNING: The server did not provide any stacktrace information)
最佳答案
在添加 cookie 之前,您必须加载要添加 cookie 的网站。
所以你的代码应该是这样的:
InternetExplorerDriver driver = .....;
driver.get("http://my.testing.site");
driver.manage().add(myCookie);
我认为错误跟踪器中为此提出了一个问题,我会看看能否将其挖掘出来。
编辑
这是其中一张票:
关于java - Selenium InternetExplorerDriver 添加 cookie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15947750/