Selenium Interview Questions and Answers Set 3

21. How to get typed text from a textbox?

Use get Attribute (“value”) method by passing arg as value.
String typedText = driver.findElement (By.xpath (“xpath of box”)).get Attribute (“value”)); 

22. What are the different exceptions you got when working with WebDriver?

• ElementNotVisibleException
• ElementNotSelectableException
• NoAlertPresentException
• NoSuchAttributeException
• NoSuchWindowException
• TimeoutException
• WebDriverException 

23. What are the languages supported by WebDriver?

Python, Ruby, C# and Java are all supported directly by the development team. There are also WebDriver implementations for PHP and Perl. 

24. How do you clear the contents of a textbox in selenium?

Use clear () method.

driver.findElement (By.xpath (“xpath of box”)).clear (); 

25. What is a Framework?

A framework is set of automation guidelines which help in Maintaining consistency of Testing, Improves test structuring, Minimum usage of code, Less Maintenance of code, Improve reusability, Non Technical testers can be involved in code, a Training period of using the tool can be reduced, Involves Data wherever appropriate.

There are five types of the framework used in software automation testing:

• Data Driven Automation Framework
• Method Driven Automation Framework
• Modular Automation Framework
• Keyword Driven Automation Framework
• Hybrid Automation Framework, it‟s basically a combination of different frameworks. (1+2+3). 

SOFTWATE TESTING
Weekend / Weekday Batch

26. What is test automation or automation testing?

Test automation or automation testing is the process of using specialized software to control the execution of tests and compare the results with expected outcomes. Automation testing can help reduce the time, cost, and effort required to test software applications by automating repetitive tasks and allowing testers to focus on more critical test cases.

27. What are the advantages of selenium WebDriver?

a) It supports with most of the browsers like Firefox, IE, Chrome, Safari, Opera etc. b) It supports with most of the language like Java, Python, Ruby, C# etc.

b) Doesn‟t require to start the server before executing the test script.
c) It has actual core API which has binding in a range of languages. d) It supports of moving mouse cursors.
e) It supports to test iphone/Android applications. 

28. What is WebDriverBackedSelenium?

WebDriverBackedSelenium is a kind of class name where we can create an object for it as below:

Selenium WebDriver= new WebDriverBackedSelenium

(WebDriver object name, “URL path of website”)

The main use of this is when we want to write code using both WebDriver and Selenium RC, we must use above-created object to use selenium commands. 

29. Explain the difference between assert and verify commands.

The assert command is used to check if the given condition is true or not. If the condition is true, then the execution of the program will continue. If the condition is false, then the execution of the program will stop.
The verify command is used to check if the given condition is true or not. If the condition is true, then the execution of the program will continue. If the condition is false, then the execution of the program will not stop, but an error message will be displayed.

30. What is Selenium Grid?

Selenium Grid allows you to run your tests on different machines against different browsers in parallel. That is, running multiple tests at the same time against different machines, different browsers, and operating systems.
Essentially, Selenium Grid support distributed test execution. It allows for running your tests in a distributed test execution environment.