LambdaTest Community

Find answers, support, and inspiration from other users

Questions
LambdaTest Community
Answered

How do I run Selenium IDE scripts in Selenium RC using PHPUnit?

I want to run Selenium IDE scripts in Selenium RC using PHPUnit, can anyone please tell me how to do it.

Up Vote Down Vote 0 Votes
Posted 4 months ago

Answers


To integrate Selenium RC with PHP, you need PHPUnit framework which supports Selenium test cases. You need to do the following steps.

And also check this, The PHP Testing Framework

  1. Download and run Selenium RC server.
  2. Write a selenium test case by extending to PHPUnit Selenium Test Case class.
  3. Then run your test case as you would run any other PHPUnit test cases.
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class WebTest extends PHPUnit_Extensions_SeleniumTestCase
{
    protected function setUp()
    {
        $this->setBrowser('*firefox');
        $this->setBrowserUrl('http://www.example.com/');
    }
    public function testTitle()
    {
        $this->open('http://www.example.com/');
        $this->assertTitleEquals('Example Web Page');
    }
}
?>
Up Vote Down Vote 0 Votes
Posted 2 months ago