Part 5: Usages Of Javascripts In Selenium: Understanding Method executeAsyncScript Of JavascriptExecutor

Hello folks, In last post we have learnt about executeScript methods of JavascriptExecutor interface. There is another method called executeAsyncScript in JavascriptExecutor interface which is not frequently used. But we must be aware about it usage so that we can use whenever required. First let’s learn what is Synchronous and Asynchronous? In very simple words, Synchronous = Blocking

Read More

Part 4: Usages Of Javascripts In Selenium: Understanding Method executeScript Of JavascriptExecutor

Hello folks, In this post, we will learn about method executeScript of JavascriptExecutor interface. JavascriptExecutor interface provides two methods to execute JavaScript commands. executeScript : To execute synchronized JavaScript script commands executeAsyncScript: To execute asynchronous JavaScript commands We will learn about “executeScript ” method in this post. Synatx: java.lang.Object executeScript(java.lang.String script,java.lang.Object… args) As per selenium doc, above method executes JavaScript in the context of

Read More

Part 2: Usages Of Javascripts In Selenium: How To Run Javascript Commands In Selenium

Hello folks, In previous post, we have learnt why do we need javascript in Selenium webdriver.  In this post we will learn how to run javascript commands in selenium webdriver. Selenium people provides an interface named “JavascriptExecutor“, which provides declaration of two methods as below: Object executeScript(String arg0, Object… arg1); Object executeAsyncScript(String arg0, Object… arg1);

Read More

Part 1: Usages Of Javascripts In Selenium: Why We Need Javascript Commands In Selenium

Hello Folks, We will see series of posts on Usage of JavaScripts in Selenium. Let’s start with basics. What is JavaScript? Definition from JS offical website: “JavaScript (“JS” for short) is a full-fledged dynamic programming language that, when applied to an HTML document, can provide dynamic interactivity on websites.” I hope you should be aware of basic js. If not, you can

Read More

Why Do We Up cast Browser Driver Class Object To WebDriver?

Hello Folks, In this post, we will learn about a frequently asked interview question in selenium that “Why we upcast a browser driver class object to WebDriver type?”. OR, Why do we write as below: WebDriver driver= new FirefoxDriver(); WebDriver driver= new ChromeDriver (); Why not as below: FirefoxDriver driver= new FirefoxDriver(); ChromeDriver driver= new ChromeDriver (); Let’s

Read More

Please wait...

Subscribe to new posts to become automation expert

Want to be notified when my new post is published? Get my posts in your inbox.