Permalink
Browse files

Merge pull request #266 from zerkms/selenium-2.35-handshake-change

Fixed the issue with new selenium v2.35 session id retrieval handshake
  • Loading branch information...
2 parents cb93ab2 + 13ca939 commit a573a765f484b0ce7c6afe767492e627b4c269d6 @giorgiosironi committed Aug 21, 2013
Showing with 12 additions and 1 deletion.
  1. +12 −1 PHPUnit/Extensions/Selenium2TestCase/Response.php
@@ -83,6 +83,17 @@ public function getValue()
*/
public function getURL()
{
- return new PHPUnit_Extensions_Selenium2TestCase_URL($this->info['url']);
+ $url = $this->info['url'];
+ $sessionId = $this->jsonResponse['sessionId'];
+
+ // if url doesn't have sessionId included - append it manually
+ // this change was performed in selenium v2.34
+ // @see https://code.google.com/p/selenium/issues/detail?id=6089
+ // @see https://github.com/sebastianbergmann/phpunit-selenium/issues/265
+ if (strpos($url, $sessionId) === false) {
+ $url .= '/' . $sessionId;
+ }
+
+ return new PHPUnit_Extensions_Selenium2TestCase_URL($url);
}
}

0 comments on commit a573a76

Please sign in to comment.