I am trying to use PHPUnit with selenium
I start the server
java -jar c:/xampp/selenium-server-standalone-2.18.0.jar
This is my test
require_once 'PHPUnit/Extensions/Selenium2TestCase.php';
class WebTest extends PHPUnit_Extensions_Selenium2TestCase {
protected function setUp() {
$this->setBrowser("*chrome");
$this->setBrowserUrl("http://localhost/");
}
public function testMyTestCase() {
$this->url('my/url/index.php');
$link = $this->byId('1-m-0');
$this->assertEquals('11', $link->text());
}
}
Item with id=”1-m-0″ exists on page, but test fails cause it gets element as null.
I have tried with other elements, SeleniumTestCase class (with the same server) but not luck !
What i do wrong?
Ok, found it out. Here is my class now :
This article helped me:
http://devzone.zend.com/1014/acceptance-testing-of-web-applications-with-php/
I m using this selenium server: selenium-server-standalone-2.18.0.jar