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 … Continue reading Why Do We Up cast Browser Driver Class Object To WebDriver?
Why WebDriver Is An Interface?
Hello Folks, We will see a very important topic as well as frequently asked interview question: "Why WebDriver is an interface?". Let's start this post with a small story. There are three "builders" and all builders do the same work such as building a house, interior designing, wooden works etc. But all three builders have … Continue reading Why WebDriver Is An Interface?
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). … Continue reading What will happen if we pass NULL as argument in sendKeys() method Of Selenium WebDriver
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 … Continue reading How To Select Random Value From Any Drop down In Selenium Web Driver
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. … Continue reading How To Verify Functionality Of Back To Top Button In 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 … Continue reading Singleton Design Pattern In Selenium WebDriver
FindBys Annotation In Page Factory In Selenium WebDriver
Hello Folks, In this post, we will learn about another annotation in Page Factory called FindBys. Suppose, you need to find count of web elements who satisfy all below criteria: whose id is "ABC" whose name is "DEF". whose xpath is "XYZ". It will be difficult to write normally but @FindBys annotation makes it very simple for … Continue reading FindBys Annotation In Page Factory In Selenium WebDriver
FindAll Annotation In Page Factory In Selenium WebDriver
Hello Folks, In this post, we will learn about another annotation in Page Factory called FindAll. Suppose, you need to locate below web elements and find out counts: All web elements whose class name is "ABC". All web elements whose id is "DEF". All web elements whose linkText is "Sometext". Generally you will write as … Continue reading FindAll Annotation In Page Factory In Selenium WebDriver
Why It Is Not Possible To Read Locators From External Sources In Page Factory Of Selenium WebDriver
Hello Folks, Many automation tester wants to read locators from external sources like database, properties file or excel sheets. Reading locators from external sources and using it in your program is very easy if we don't use Page Factory. It becomes difficult because of @FindBy annotation. What is annotation in Java? Annotations in Java are … Continue reading Why It Is Not Possible To Read Locators From External Sources In Page Factory Of Selenium WebDriver
Creating Object Repository In Selenium WebDriver Using Properties File As An External Source
Hello Folks, We have seen Page Object Model in previous posts and you must be noticing that we are writing locators within code. It has its own disadvantages as below: For any modification in locator, you must need to touch the code. Difficult for manual tester or beginner in automation testing to find out correct … Continue reading Creating Object Repository In Selenium WebDriver Using Properties File As An External Source