Created
October 7, 2021 00:29
-
-
Save dannyshain/231ea8f37440f6e632bd9a17c1711680 to your computer and use it in GitHub Desktop.
This file contains 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
MobileElement slider = driver.findElementByAccessibilityId("slider"); | |
Point source = slider.getLocation(); | |
PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger"); | |
Sequence sequence = new Sequence(finger, 1); | |
sequence.addAction(finger.createPointerMove(ofMillis(0), | |
PointerInput.Origin.viewport(), source.x, source.y)); | |
sequence.addAction(finger.createPointerDown(PointerInput.MouseButton.MIDDLE.asArg())); | |
sequence.addAction(new Pause(finger, ofMillis(600))); | |
sequence.addAction(finger.createPointerMove(ofMillis(600), | |
PointerInput.Origin.viewport(), source.x + 400, source.y)); | |
sequence.addAction(finger.createPointerUp(PointerInput.MouseButton.MIDDLE.asArg())); | |
driver.perform(singletonList(sequence)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment