function Selenium2Driver::rightClick
Overrides CoreDriver::rightClick
File
-
vendor/
lullabot/ mink-selenium2-driver/ src/ Selenium2Driver.php, line 893
Class
- Selenium2Driver
- Selenium2 driver.
Namespace
Behat\Mink\DriverCode
public function rightClick(string $xpath) {
if ($this->isW3C()) {
$actions = array(
'actions' => [
[
'type' => 'pointer',
'id' => 'mouse1',
'parameters' => [
'pointerType' => 'mouse',
],
'actions' => [
[
'type' => 'pointerMove',
'duration' => 0,
'origin' => [
Element::WEB_ELEMENT_ID => $this->findElement($xpath)
->getID(),
],
'x' => 0,
'y' => 0,
],
[
'type' => 'pointerDown',
"button" => 2,
],
[
'type' => 'pause',
'duration' => 500,
],
[
'type' => 'pointerUp',
"button" => 2,
],
],
],
],
);
$this->getWebDriverSession()
->postActions($actions);
$this->getWebDriverSession()
->deleteActions();
}
else {
$this->mouseOver($xpath);
$this->getWebDriverSession()
->click(array(
'button' => 2,
));
}
}