Created
February 16, 2012 17:12
-
-
Save isaulv/1846523 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
| #my webdriver wait in python: this is wrapped in a class called Browser | |
| def presence_of_at_least_one_element_located_by(self, driver, by, value) | |
| """Expected Condition" # Java term in the java bindings""" | |
| try: | |
| elements = driver.find_elements(by, value) | |
| if elements: # if i am calling find elementS i want at least one, not an empty list | |
| return elements | |
| else: | |
| return false # python webdriver wait is looking for a true or false until the timeout | |
| except StaleElementReferenceException as sere: | |
| return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment