So for that at first we have to set the system property “webdriver.chrome.driver” and need to provide the path of the executable file of the chrome driver. The code block is mentioned below:- Now we can set the options of the chrome driver. This step is optional. Here we can set the execution mode of…
Tag: Selenium Interview
How to handle the Dynamic Google suggestions using Selenium
Many times we have to handle the suggestions in the search box dynamically. As shown below for the google search page. When typed “selenium” word, it’s showing so many suggestions:- Now if we want to select only “selenium interview questions” then how to do that? As these options appears dynamically, so by using fixed locator…
First and very easy sample Selenium WebDriver Script
In the below mentioned script the following user actions are performed:- User opens the browser. User enter the URL of google home page and lands on the Google home Page. User clicks on the search box and provided input text “Selenium Test”. User waits for 4000 mill seconds. User clicks on the Search button. Now…
findElement method in Selenium WebDriver
To find any web element in any webpage this findElement method is used by Selenium WebDriver. This is an abstract method and defined under the SearchContext interface. as mentioned in the source code. But this SeachContext interface is also implemented by the SeleniumWebDriver interface as mentioned in here. As mentioned in the source code comment…
Selenium WebDriver is a class or interface?
The best way to answer this question is to check the source code of Selenium WebDriver. The source code can be found here. In that source code it is clearly mentioned that, the Selenium WebDriver is an interface. The clear and concise source code of selenium WebDriver interface is mentioned below:- import org.openqa.selenium.logging.LoggingPreferences; import org.openqa.selenium.logging.Logs;…
Web Element in Selenium is a class or interface?
To answer this question, we have to take a look at the source code of Selenium WebDriver. The source code can be found here. In that source code, it’s clearly mentioned that WebElement is an interface. The clear and concise code of WebElement interface is mentioned below. So, as mentioned above, the WebElement interface has…
What is Data Driven Testing Techniques in Selenium?
Data-driven testing is one of the popular testing approach. Why this approach is so popular and useful? Take a real life example. Just write the test cases to test the “Username” field for the rediffmail pages. The possible test-cases at gross level are:- Test Case ID Test Case Subject Test Case Description Test Steps Prerequisites…
What is Page Object Model (POM) in Selenium?
What is Page Object Model? It’s a design pattern , which is used by many test automation projects. The Page Object is basically a class file which acts as an interface of any web page. This class contains the web elements and many methods to interacts with those web-elements. And to interact with these pages,…
What is Encapsulation in Java?
Encapsulation is a technique to hide the nature of the declared variables within a class and this variables can only be accessed from another class via some public methods. Check the below example where the variable is declared as private and this variable can only be accessed from other class by using the public methods…