2

I am using Selenium 2.34.0 + phpunit and it cant recognize my "code". I am using $this->url('blqblq') and the error is it cant be recognize command url. Do you have same problem? When i "revert" to 2.33 the tests are working flawlessly :). My phpunit version is 3.7.21 , phpunit_Selenium is latest 1.3.1. Thank you. My "code" is

<?php
//require_once 'setupfile.php';
  class testtestest extends PHPUnit_Extensions_Selenium2TestCase //extends setupfile
{
       public function setUp()
         {
            $this->setBrowser('firefox');
            $this->setBrowserUrl('http://www.stackoverflow.com');
         }    

         public function testexample()
         {
              $this->url('http://www.stackoverflow.com');
              $this->assertEquals('Example WWW Page', $this->title());
         }
}

?>

My debug log file from selenium 2.34.0 is located here -> http://fikata.ivo.so/test234.txt

Edit 2 :)

i went to Responce.php in phpunit_selenium and var_dump($info); then in: 1)2.34 the vardump return this:

PHPUnit 3.7.21 by Sebastian Bergmann.

Earray(26) {
  'url' =>
  string(36) "http://127.0.0.1:4444/wd/hub/session"
  'content_type' =>
  string(30) "application/json;charset=UTF-8"
  'http_code' =>
  int(200)........

2)2.33 the vardump return this:

PHPUnit 3.7.21 by Sebastian Bergmann.

Farray(26) {
  'url' =>
  string(73) "http://127.0.0.1:4444/wd/hub/session/66aacaaa-6690-46a4-9d1b-5f75b
3d48d53"
  'content_type' =>
  string(30) "application/json;charset=UTF-8"
  'http_code' =>
  int(200)
  'header_size' =>
  int(536).........

Obviusly the difference is in session id, so why its not there for 2.34. ? Please advice thanks.

2 Answers 2

1

This was a BC break by the Selenium Server. The PHPUnit bindings have been updated to be compatible with all versions of the server now:

https://github.com/sebastianbergmann/phpunit-selenium/pull/266

Upgrade to the master branch (or next release which will be 1.3.2 when available) to get the fix.

0

I'm not sure which library you're using for php-webdriver. From your code, I'm guessing Either Adam Goucher / Element-34 php-webdriver or an older version of the Facebook php-webdriver.

It looks like there have been some changes in session handling for the WebDriver binaries, and those changes aren't reflected in the element-34 webdriver bindings yet. Where I'm using those, I've been able to patch the bindings just enough to get things working (This pull request looks like it's correcting the problem: https://github.com/Element-34/php-webdriver/pull/44).

If you're using the Facebook bindings, they've recently been completely rewritten. Unfortunately, it probably means your tests are all broken until you update. The new facebook version works with WebDriver 2.34 for me here. See the new bindings here: https://github.com/facebook/php-webdriver

3
  • No i dont use either of those two. i,m using this github.com/sebastianbergmann/phpunit-selenium/tree/master/…
    – opatropa
    Aug 21, 2013 at 9:40
  • 1
    @opatropa I don't use those bindings, but the problem with most of the php binding libraries is related to a change in window / session handling in the Selenium API, judging by what I had to do to patch the Element-34 version. It looks like a similar fix has just been added to your library (see github.com/sebastianbergmann/phpunit-selenium/commit/…). I'd pull down the git changes for that repo and try again.
    – jxn
    Aug 21, 2013 at 20:23
  • You may also want to upgrade to Selenium 2.35, per references in those commits
    – jxn
    Aug 22, 2013 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.