phpunit-selenium icon indicating copy to clipboard operation
phpunit-selenium copied to clipboard

Selenium Server creates cookies on localhost domain only

Open ilia-khaustov opened this issue 12 years ago • 1 comments

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

ilia-khaustov avatar Mar 07 '13 04:03 ilia-khaustov

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

giorgiosironi avatar Mar 09 '13 10:03 giorgiosironi