5

I have installed selenium-server-standalone-2.33.0.jar, phpUnit, selenium extension for phpUnit.

This test runs ok:

$this->url('/');
$this->assertEquals('my title',$this->title());

But when I try to use $this->byClassName('sideNav');

I get

Uncaught exception 'BadMethodCallException' with the message 'The command http://127.0.0.1:4444/wd/hub/session/b527030f-a368-4845-b50c-2889910da917 is not recognized by the server.

What can be the reason?

Post is related to a rapidly changing event.

0

Try the following, it should work:

$this->element($this->using('css selector')->value('*[class="sideNav"]'));

instead of

$this->byClassName('sideNav');
0

You need to run selenium server before you execute your test cases.

Try following steps:

  1. Open Terminal / CMD.
  2. Navigate to directory where your selenium-server-standalone-2.33.0.jar is stored.

E.g: cd /User/Documents/Selenium

  1. Execute following command to run the server

    java -jar selenium-server-standalone-2.33.0.jar

This will start selenium server.

Note: You will require JRE to be installed to run jar files in your machine.

0

Here is an example from the tests of the project of how to use this method:

public function testElementsKnowTheirTagName()
{
    $this->url('html/test_element_selection.html');
    $element = $this->byClassName('theDivClass');
    $this->assertEquals('div', $element->name());
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy