Created
December 24, 2015 18:20
-
-
Save codyc4321/f4c03c0606c2e3e4ff5b 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
def activate_hidden_element(html_id=None, html_name=None, driver=None): | |
action = webdriver.ActionChains(driver) | |
if html_id: | |
element = driver.find_element_by_id(html_id) | |
elif html_name: | |
element = driver.find_element_by_name(html_name) | |
action.move_to_element(element).click().perform() | |
return element | |
# works, but nothing else does | |
activate_hidden_element(html_id="panel_css", driver=driver) | |
# pyperclip.paste() doesn't work | |
# blows up ElementNotVisibleException: Message: Element is not currently visible... | |
find_box_and_fill(html_id="id_code_css", value="test", driver=driver) | |
# blows up ElementNotVisibleException: Message: Element is not currently visible... | |
activate_hidden_element(html_id="id_code_css", driver=driver) | |
# blows up WebDriverException: Message: $(...) is null | |
driver.execute_script('$("#panel_css").click();') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment