Part 4

16 : How to press ENTER key button on text box In selenium webdriver?
Answer : To press ENTER key using selenium WebDriver software automation tool, We need to use selenium Enum Keys with Its constant ENTER as bellow.
driver.findElement(By.xpath("//input[@id='gbqfq']")).sendKeys(Keys.ENTER);

17 : How many types of waits available In selenium WebDriver

When we talk about drag and drop kind of tricky operations, We need to use Advanced User Interactions API of selenium WebDriver. It Is not so simple and at the same time not too much hard. We need to write multiple syntax to perform drag and drop action because you need to take multiple actions like pick the element by clicking and holding mouse then move mouse to destination place and then drop element by releasing mouse. Same thing you have to perform In webdriver.

Part 3

11 : Can you tell me the syntax to open/launch Firefox browser In WebDriver software testing tool?
Answer : We can open new Mozilla Firefox browser Instance using bellow given syntax In WebDriver software testing tool.

System.setProperty("webdriver.gecko.driver", "D:\\Selenium Files\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
VIEW PRACTICAL example.

Part 2

6 : What are the benefits of automation testing.
Answer : We can get bellow given benefits If automate our software testing process.
  • Fast Test Execution : Manual software testing process Is time consuming. Automation tests are faster and takes less time to execute tests compared to manual test execution.

Now a days, Many companies are using selenium webdriver to automate web application testing process. Requirements of selenium webdriver automation testing tool professionals Is Increasing day by day. Here I am presenting list of selenium webdriver Interview questions with answers to help you attending Interview In IT companies.

You can VIEW ALL SELENIUM TUTORIALS to understand each and every point on selenium webdriver In deep.

Selenium Interview Questions With Answers

Part 1

1 : What Is Selenium WebDriver/Selenium 2?
Answer :

In our WebDriver data driven framework creation, We have Implemented calc software tests In all calc test cases of WebDriver data driven framework In STEP 30. Now supposing, You wants to capture screenshot of software web page when your test fails. It will helps you to analyse the test failure reason. Based on web page screenshot,
you can easily find out the test failure reason. Same way, Supposing you wants to capture screenshot when your test pass. This step will describe you how to capture screenshot on test failure or software automation test pass.

STEP 31

We have already Implemented calc summation test In "SuiteOneCaseOne.java" test case of our webdriver DDF creation STEP 26. Now, Its time to Implement Calc test In remaining three test cases of our webdriver DDF. We will Implement calc subtraction, multiplication and division tests In "SuiteOneCaseTwo.java",  "SuiteTwoCaseOne.java" and "SuiteTwoCaseTwo.java" test cases respectively In this step.

STEP 30

We have Implemented getElementByXPath function to locate element by XPath In PREVIOUS STEP. As you know, There are many different element locators available In web driver. So obviously, Sometimes you needs to locate elements by other locator types too ( cssSelector, ID, Name etc..) when It Is not possible to locate element by XPath. Let us Implement those functions In our DDF.

STEP 29

We have created object repository In selenium webdriver data driven framework creation STEP 27. So now, our all web element's xpath or CSSPath or any other locators will be stored In object repository Instead of test cases files. Now let us try to compact webdriver code by creating getElementByXPath function to return web page element on demand.

STEP 28

In Selenium WebDriver software test data driven framework creation STEP 26, We have Implemented simple calc software test. Now In this step, We will create object repository using .properties file to store software web page element's locators like xpath Locator, cssSelector Locator, className Locator, id Locator, linkText Locator, name Locator,
partialLinkText Locator and tagName Locator. We can call It as object repository because we are storing objects In that .properties file.
STEP 27