Reputation: 145
I'm using a phpunit extension phpunit-selenium to run a test on my website using selenium grid, but whenever I try running tests on Internet Explorer, I get an error message stating:
Unable to add cookie to page (WARNING: The server did not provide any stacktrace information)
The issue seems to stem from phpunit-selenium trying, but unable to set a cookie "PHPUNIT_SELENIUM_TEST_ID."
I found example code of setting and removing cookies from here, and the interesting thing is the code from the link executes just fine on IE, displaying contents of the cookie, but when I try to add cookies to my site, it fails.
I've tried possible solutions, such as getting the website before attempting to set the cookie, and turning "Protected Mode" off.
Is there another security setting on IE or something that I'm missing?
Upvotes: 4
Views: 1930
Reputation: 399
I used this solution and it works for me on ie 11
Upvotes: 1
Reputation: 8251
I ran into a similar problem running Selenium tests in IE9.
Try setting IE as the default browser.
http://kenhirakawa.com/selenium-unable-to-add-cookie-to-page/
Upvotes: 1
Reputation: 57247
I had this error because I was following the tutorial. The ironing is delicious.
The first example in the documentation is for PHPUnit_Extensions_Selenium2TestCase
. All of the others on the page are for PHPUnit_Extensions_SeleniumTestCase
.
Perhaps change
extends PHPUnit_Extensions_Selenium2TestCase
to
extends PHPUnit_Extensions_SeleniumTestCase
Upvotes: 0
Reputation: 8548
Not sure if this would work but definitely worth a try, Open IE as an Administrator and inside Internet Options, under the Security tab unselect the "Enable Protected Mode" checkbox. Now try your selenium tests again.
Upvotes: -1