Created
June 10, 2013 16:55
-
-
Save AutomatedTester/5750380 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 | |
| #tested with 1.0.1 June 5 | |
| # setup boilerplate: | |
| m = Marionette() | |
| m.start_session() | |
| m.switch_to_frame(2) | |
| # Find the container element to dispatch scroll events to: | |
| thumbnails = m.find_element("id", "thumbnails") | |
| #scroll down | |
| action = Actions(m) | |
| action.press(thumbnails).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).wait(0.1).move_by_offset(0, -20).release().perform() | |
| # pause before scrolling up | |
| time.sleep(3) | |
| # Note: once perform is called, chain of commands is cleared. | |
| #scroll up | |
| action.press(thumbnails).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).wait(0.1).move_by_offset(0, 20).release().perform() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment