Created
June 10, 2013 17:02
-
-
Save AutomatedTester/5750415 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
| from marionette import Marionette, Actions, MultiActions | |
| import time | |
| # Setup boilerplate: | |
| m = Marionette() | |
| m.start_session() | |
| m.switch_to_frame(2) | |
| # choose a photo | |
| lis = m.find_elements("tag name", "li") | |
| lis[0].tap() | |
| imgs = m.find_elements("tag name", "img") | |
| our_image = imgs[2] | |
| # pause a second | |
| time.sleep(1) | |
| # zoom | |
| # Finger 1 | |
| action1 = Actions(m) | |
| action1.press(our_image, 150, 50).move_by_offset(10, 0).wait(0.2).move_by_offset(10, 0).wait(0.2).move_by_offset(10,0).wait(0.2).move_by_offset(10,0).release() | |
| # Finger 2 | |
| action2 = Actions(m) | |
| action2.press(our_image, 160, 50).move_by_offset(-10, 0).wait(0.2).move_by_offset(-10, 0).wait(0.2).move_by_offset(-10,0).wait(0.2).move_by_offset(-10,0).release() | |
| # add both fingers and perform | |
| multi = MultiActions(m) | |
| multi.add(action1).add(action2).perform() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment