Selenium export to PHP
Posted: Thu Apr 16, 2009 2:56 am
I have created a small script using the Selenium IDE and exported it to PHP.
Now I want to run the simple test via the command line not the IDE. I have tried quite a few tutorials online but none worked. I noticed that at the top the generated PHP includes a SeleniumTestCase.php in the PHPUnit extensions directory. So I install PHPUnit but I still am having problems.
This is my script...
As you can see it is very simple, I dont understand why it is so difficult to get this to work.
I would be grateful for any help.
Now I want to run the simple test via the command line not the IDE. I have tried quite a few tutorials online but none worked. I noticed that at the top the generated PHP includes a SeleniumTestCase.php in the PHPUnit extensions directory. So I install PHPUnit but I still am having problems.
This is my script...
Code: Select all
<?php
require_once '../../resources/phpunit/PHPUnit-3.3.9/PHPUnit/Extensions/SeleniumTestCase.php';
class Example extends PHPUnit_Extensions_SeleniumTestCase
{
function setUp()
{
$this->setBrowser("*chrome");
$this->setBrowserUrl("http://192.168.2.2:8084/index/login");
}
function testMyTestCase()
{
$this->open("/index/login");
$this->type("email", "*****@*******.com");
$this->type("password", "******");
$this->click("submit");
$this->waitForPageToLoad("30000");
$this->assertTrue($this->isTextPresent("Errror"));
}
}
?>
I would be grateful for any help.