Skip to content

Instantly share code, notes, and snippets.

@bbbco
Created July 16, 2013 14:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbbco/6009319 to your computer and use it in GitHub Desktop.
Save bbbco/6009319 to your computer and use it in GitHub Desktop.
Selenium WebDriver // Highlights the element object in a yellow border
driver.executeScript("arguments[0].setAttribute(arguments[1], arguments[2])", element, "style", "border: 2px solid yellow; color: yellow; font-weight: bold;")
@sandeepthukral
Copy link

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.

@zhonghu
Copy link

zhonghu commented Apr 10, 2014

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