Created
August 27, 2014 18:09
-
-
Save azakordonets/a006853f9532671aac6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * A convenience method that performs click-and-hold at the location of the source element, moves by a given offset, then releases the mouse. | |
| * @param slider webElement | |
| * @param xOffset - horizontal move offset. Positive value means moving to the right, negative - to the left | |
| * @param yOffset - vertical move offset. Positive value means moving up, negative - down | |
| * @throws Exception | |
| */ | |
| public void dragAndDrop(WebElement slider, int xOffset, int yOffset) throws Exception { | |
| Actions moveSlider = new Actions(driver); | |
| Action action = moveSlider.clickAndHold(slider) | |
| .moveByOffset(xOffset, yOffset) | |
| .release() | |
| .build(); | |
| action.perform(); | |
| Thread.sleep(500); | |
| waitForPageToLoad(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment