I am trying to execute a functional test using Selenium 2 and PHPUnit.
In the class 'Selenium2TestCase.php', I found this code:
class PHPUnit_Extensions_Selenium2TestCase_SessionCommand_Click extends PHPUnit_Extensions_Selenium2TestCase_Command
{
const LEFT = 0;
const MIDDLE = 1;
const RIGHT = 2;
public function __construct($argument, PHPUnit_Extensions_Selenium2TestCase_URL $url)
{
if (is_null($argument)) {
$jsonParameters = NULL;
} elseif (!is_scalar($argument) || !in_array($argument, array(
self::LEFT, self::RIGHT, self::MIDDLE
))) {
throw new BadMethodCallException('Wrong parameter for click(): expecting 0, 1 or 2.');
} else {
$jsonParameters = array('button' => $argument);
}
parent::__construct($jsonParameters, $url);
}
public function httpMethod()
{
return 'POST';
}
}
But I don't know how to use it to simulate a right click.