JavaScript Executor in Selenium WebDriver

Refer to the below Links for Practise
Collections in Java
Complete List of Selenium Basics
50 Real Time Interview Questions
Real Time Scenario’s
Java Platform Standard Edition 8 Documentation
Complete List of Java Basics
Java Quiz
Java OOPS Quiz
Selenium Advanced Quiz
Selenium Quiz
Selenium WebDriver Resume

Javascript Executor

JavascriptExecutor is an interface available in the package org.openqa.selenium.
This interface is implemented by classes ChromeDriver, EdgeDriver, EventFiringWebDriver,
FirefoxDriver, InternetExplorerDriver, OperaDriver, RemoteWebDriver, SafariDriver

1. Executes JavaScript in the context of the currently selected frame or window.
2. The script fragment provided will be executed as the body of an anonymous function.
3. Within the script, use document to refer to the current document.
4. To interact with Highcharts: Interactive JavaScript charts for your webpage,
JavascriptExecutor will be helpful.
Reference Link->https://www.highcharts.com/

JavascriptExecutor Program:

Console Output:

Leave a Reply

Your email address will not be published. Required fields are marked *