Category: Selenium Topics

This category contains topics of Selenium.

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 […]

Part 3: Usages Of Javascripts In Selenium: Problem You Might Face While Executing Javascript Commands In Selenium

Hello Folks, In this post, I will explain a problem which beginner in selenium may encounter and you don’t know how to resolve it. I have also faced the same issue and after lot of googling , I found the solution. When you try to execute any javascript command, you might see error message as […]

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); […]

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 […]

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 […]

What will happen if we pass NULL as argument in sendKeys() method Of Selenium WebDriver

Hello Guys, We will learn a small topic which is also an interview question in this post. What will happen if we pass NULL as argument in sendKeys() method? Above question has two answers based on how you are passing null values to sendKeys method. Way 1: Passing null directly to sendKeys method as sendKeys(null).  […]

How To Select Random Value From Any Drop down In Selenium Web Driver

Hello Guys, When you are automating any functionality, you may need to select value from drop down. What should be selected value, generally you want it from user. There might be many scenarios where you just need to select any value from drop down. For example: Consider User registration where you need to select country […]

How To Verify Functionality Of Back To Top Button In Selenium WebDriver

Hello Folks, In this post, we will see an interesting scenario . When we open a website and scroll down, suddenly a button appears, which says “Click me anytime if you want to go on top again”. An example is given below: You need to verify functionality of Back To Top button using selenium webdriver. […]

Singleton Design Pattern In Selenium WebDriver

Hello Folks, Today we will see implementation of Singleton design pattern in selenium webdriver. Before we learn about implementation in Selenium webdriver, we must know about Singleton pattern. Singleton Design Pattern: When we develop a class in such a way that it can have only instance at any time, is called Singleton design pattern. It […]

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.