-
-
Save dariodiaz/3104601 to your computer and use it in GitHub Desktop.
python: Highlights a Selenium Webdriver element
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
import time | |
def highlight(element): | |
"""Highlights (blinks) a Selenium Webdriver element""" | |
driver = element._parent | |
def apply_style(s): | |
driver.execute_script("arguments[0].setAttribute('style', arguments[1]);", | |
element, s) | |
original_style = element.get_attribute('style') | |
apply_style("background: yellow; border: 2px solid red;") | |
time.sleep(.3) | |
apply_style(original_style) |
Thanks,
I did add a seccond loop to make it blink...
Thank you
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Such a helpfull code! Thanks a lot!