Selenium WebDriver - How to hold the right mouse button?

Using Selenium 2.0 WebDriver (java), I need to check some navigation (rotate, pan ...)

I need to be able to hold the RIGHT button while moving the mouse.

Likewise, I should be able to hold down the MIDDLE button while moving the mouse.

This seems to be possible only with the LEFT button.

Actions actions = new Actions(driver);
actions.clickAndHold().perform();

The next question: I do not mean a single menu, button, widget, but with a 3D environment such as GoogleMap, where I need to simulate pan, rotate and zoom with the MIDDLE button, the RIGHT button, and even the mouse wheel ...

Any help?

+4
source share
2

, - - , , # java

Actions actions = new Actions(WebDriver);
actions.ContextClick(webElement)
                                               .SendKeys(Keys.Down)
                                               .SendKeys(Keys.Down)
                                               .Build()
                                               .Perform();

actions.ClickAndHold() actions.MoveToElement() ,

, ,

0

. Button3 Button2

Robot robot=new Robot();
robot.mousePress(InputEvent.BUTTON3_DOWN_MASK);
robot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK);

Robot robot=new Robot();
robot.mousePress(InputEvent.BUTTON2_DOWN_MASK);
robot.mouseRelease(InputEvent.BUTTON2_DOWN_MASK);
0

All Articles