php - 无法使用带有 php 的 Selenium 将 cookie 添加到页面

标签 php internet-explorer cookies selenium phpunit

我正在使用 phpunit 扩展 phpunit-selenium 在我的网站上使用 selenium 网格运行测试,但是每当我尝试在 Internet Explorer 上运行测试时,我都会收到一条错误消息,指出:

Unable to add cookie to page (WARNING: The server did not provide any stacktrace information)

问题似乎源于 phpunit-selenium 尝试,但无法设置 cookie“PHPUNIT_SELENIUM_TEST_ID”。

我从 here 中找到了设置和删除 cookie 的示例代码,有趣的是链接中的代码在 IE 上执行得很好,显示 cookie 的内容,但是当我尝试向我的站点添加 cookie 时,它​​失败了。

我已经尝试过可能的解决方案,例如在尝试设置 cookie 之前获取网站,并关闭“保护模式”。

IE 上是否还有其他安全设置或我缺少的设置?

最佳答案

我在 IE9 中运行 Selenium 测试时遇到了类似的问题。
尝试将 IE 设置为默认浏览器。

http://kenhirakawa.com/selenium-unable-to-add-cookie-to-page/

关于php - 无法使用带有 php 的 Selenium 将 cookie 添加到页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18407849/

相关文章:

php - 过滤数据后出现 JSON 错误,但页面无需过滤即可正常加载

php - 从 PHP 网络脚本运行 ffmpeg

javascript - IE 11 : How to Open JavaScript genereted file without Open/Save dialog?

html - css ie 无重复错误

PHP 设置 cookie 生命周期

php - 正确的 PHP 循环显示帖子类别

php - 将 imagick 安装到 azure

c# - 我如何为 shdocvw.dll 创建一个强命名的互操作 dll

javascript - 如何检测 Javascript 中是否设置了 cookie?

google-app-engine - 是否可以在 Google App Engine 中设置 session cookie 路径?