How to Use JavaScript Executor in Selenium | Javascript Executor in Selenium(With Code) | Day 28

Опубликовано: 06 Июль 2020
на канале: The Testing Academy
3,004
27

✅ Join us - https://sendfox.com/thetestingacademy

In this video, We are going to learn How to Use Javascript Executor in Selenium.

🚀 Day 30 Task : JavaScript Executor in Selenium
🚀 All Task List : https://scrolltest.com/automation/task
🚀 Watch Full Playlist : https://apitesting.co/30days
🚀Download MindMap : https://scrolltest.com/automation/day28

✅ What is Javascript Executor in Selenium.?
JavaScriptExecutor is one of the interfaces in selenium. The basic advantage of JavaScriptExecutor is it provides a way to execute JavaScript in Selenium Webdriver.

Sometimes locators may not work, in that case JavaScriptExecutor will helps to interact with the web elements on the particular webpage.

The reason behind this is; even selenium webdriver internally converts language bindings into its equivalent JavaScript and injects into the respective browser.

JavaScriptExecutor is also very useful to identify and interact with the hidden and disabled elements on the web pag.


✅ Why JS executor required?
Sometimes elements accessible by JS not selenium traditional way
Lots of time Selenium Commands are unable to interact with Elements in Webpage.

✅ Code
2. JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript(Script,Arguments);
Script – The JavaScript to execute
Arguments –The arguments to the script(Optional). May be empty.
Returns –One of Boolean, Long, String, List, WebElement, or null.
-----------------------------------------------------
👪 Join our Community - http://bit.ly/learntesting2019
✅ Automation Tester Community - https://thetestingacademy.com
🐦Follow us on Twitter -   / itstechmode  
📖 Like us on Facebook -   / scrolltest  
🎤 Listen to our Podcast - https://anchor.fm/thetestingacademy
------------------------------------------------------

#automationtesting #manualtesting #testautomation #thetestingacademy #scrolltest


🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌

✅Selenium Training and Certification -
https://scrolltest.com/go/edureka

✅Learn Jenkins for QA -
https://bit.ly/learnjenkins-p1

✅Programming Java -
https://bit.ly/learnjava2020-p1

✅Test Automation -
https://bit.ly/learnautomation2020

✅API Testing -
https://www.learnapitesting.com

✅Cypress Tutorial with LIVE Projects -
https://cypresstutorial.com