gpt4 book ai didi

java - Selenium InternetExplorerDriver 添加 cookie

转载 作者:行者123 更新时间:2023-11-29 09:04:00 28 4
gpt4 key购买 nike

无法在 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);

我认为错误跟踪器中为此提出了一个问题,我会看看能否将其挖掘出来。

编辑

这是其中一张票:

https://code.google.com/p/selenium/issues/detail?id=1953

关于java - Selenium InternetExplorerDriver 添加 cookie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15947750/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com