0

I Installed PHPUnit_Selenium and Phpunit , I'm currently using Laravel.

If i include Require Once, it cant be found , if i don't i get Class not found.

I tried to locate Selenium2TestCase and it's found under /usr/share/PHPUnit/Extensions

Question 1 How do i direct the code to The file i need.

Question 2 Can i execute the Functions only and get the returned value? Or i must execute the whole file

Question 3 How do i execute this , i plan to store extracted results in Database.

Thanks in advance!

http://phpunit.de/manual/3.8/en/selenium.html

<?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->assertTitle('Example WWW Page');
    }
}
?>

1 Answer 1

1

Laravel isn't getting loaded.

try class WebTest extends TestCase instead.

Because this was tagged as php as well, please note this is only a solution when using Laravel..

There may be some further editing to do on TestCase.php. You'd may need to extend PHPUnit_Extensions_SeleniumTestCase there.

Sign up to request clarification or add additional context in comments.

2 Comments

Is it possible to extend a class in a class? like what you said, extend PHPUnit_Extensions_seleniumTestCase
I'm not sure exactly what you are asking, but you can chain them. Class A extends B, Class B extends C and you would have C's method available to A. So you'd have TestCase.php extend Selenium and I'm assuming Selenium already extends PHPUnit.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.