-
-
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 a lot!
great stuff! Many Thanks
Muchas gracias!
Thanks a lot.
great work thanks alot !
Thank you sir!
Thanks a million!
Awesome stuff.
Thanks - Is there a license with this code?
Thank you very much!
thanks a ton! very useful...
This's Awesome!
8 years in, still amazing, thanks!
urakoze cyane
can someone provide the screenshot of how it looks?
._patent
say what?
Such a helpfull code! Thanks a lot!
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
Useful stuff!