phpunit-selenium
phpunit-selenium copied to clipboard
Selenium Server creates cookies on localhost domain only
I'm using Selenium Server 2.25.0 + PHPUnit to test Yii application.
This application is located on remote server which is available using the domain 'test.domain.com'.
When I use 'createCookie()' method to set cookie 'cookiename', it is assigned to 'localhost' domain. So, 'getCookieByName("cookiename")' method throws exception and $_COOKIE['cookiename'] is not set either.
Selenium version: 2.25.0 OS: Windows 7 for Selenium Server/developer PC, Ubuntu 10.04 for remote server Browser: Firefox Browser version: 17.0.1
If you use the Selenium 2 API (Selenium2TestCase) there is a Builder for specifying all the available options for cookies: https://github.com/sebastianbergmann/phpunit-selenium/blob/master/PHPUnit/Extensions/Selenium2TestCase/Session/Cookie.php