I’m using PHPUnit and Selenium in my PHP project.
I have been following instruction at: http://www.phpunit.de/manual/3.6/en/selenium.html. Currently I am able to start Selenium server and I’ve done few test classes extending either PHPUnit_Extensions_Selenium2TestCase or PHPUnit_Extensions_SeleniumTestCase class.
I’ve been using https://github.com/sebastianbergmann/phpunit-selenium/blob/master/Tests/Selenium2TestCaseTest.php as my reference for Selenium2 tests.
I was trying to find methods to implement keyPress functionality but I couldn’t find it from PHPUnit_Extensions_Selenium2TestCase. It can be found from PHPUnit_Extensions_SeleniumTestCase.
Question comes here: can I use PHPUnit_Extensions_SeleniumTestCase functionality in my PHPUnit_Extensions_Selenium2TestCase classes? For instance, this keyPress functionality.
Version info:
PHPUnit: 3.6.10
selenium-server-standalone-2.21.0.jar
WHat do you need keypress for?
Not tested, but from the testcases you already refer to:
$this->keys('phpunit ');would send the keypresses p, h, p, u, n, i, t and space.