Answers

Question and Answer:

  Home  Automation

⟩ Explain me how to execute JavaScript in Selenium?

JavaScriptExecuter is used for JavaScript execution in Selenium.

A simple example:

WebDriver driver = new FireFoxDriver();

if (driver instanceof JavascriptExecutor) {

((JavascriptExecutor)driver).executeScript("{JavaScript Code}");

}

 143 views

More Questions for you: