Created
July 16, 2013 14:37
-
-
Save bbbco/6009319 to your computer and use it in GitHub Desktop.
Selenium WebDriver // Highlights the element object in a yellow border
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
driver.executeScript("arguments[0].setAttribute(arguments[1], arguments[2])", element, "style", "border: 2px solid yellow; color: yellow; font-weight: bold;") |
Hi, I guess the whole code snippet should be:
IWebDriver driver = new ChromeDriver(); // some driver
IJavaScriptExecutor js = driver as IJavaScriptExecutor;
js.ExecuteScript("javascript code",argument... ); //check the definition of ExecuteScript() API for argument details
Hope it's helpful to you.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this Gist
I am very new to Selenium and Python.
I am guessing an array with three values are passed to the function that this piece of code. Could you please explain what these three values are?
I saw this code from a StackOverflow question which is close to what I am facing right now.