You are on page 1of 5

Selenium Interview Questions

1. Can you explain about Selenium?


Selenium is an open source software testing framework used for automating web
UI applications.

2. What are the different components that Selenium supports?


 Selenium Integrated Development Environment (IDE)
 Selenium Client API
 Selenium Remote Control
 Selenium WebDriver
 Selenium Grid

3. What are the main advantages of using Selenium?


 Is an open source reliable/robust browser based automation tool for
automating web UI applications
 Scalable across environments
 Easily portable in different browser environment by using the
appropriate browser driver
 Can be built in different languages based on what language the
company is using
 Automated tests can be distributed across different machines for
parallel execution of tests

4. What is the main disadvantage of using Selenium?


 Selenium supports web based application and does not provide
support for windows based applications
 Requires a high technical expertise to build robust automation tests
using selenium web driver
 Requires third party framework tools for report generation, object
identification etc

5. What browsers are supported in Selenium?


 Internet Explorer
 Firefox
 Google Chrome
 Safari
 Opera

6. What operating systems does Selenium support?


 Windows
 Linux
 Apple OS

7. What languages does Selenium support?


 C#
 Java
 JavaScript
 Python
 Ruby
 Perl
 PHP
 Objective C

8. Can Selenium be used to test web services?


Yes, selenium can be used to test web services using SOAP UI. We use Groovy
script to integrate Selenium with SOAP UI

9. Using selenium web driver list the different ways that you locate elements?
To locate web elements we use findElement (or) findElements method.
The different ways to locate a web element is as follows:
 By.name()
 By.id()
 By.tagName()
 By.className()
 By.linkText()
 By.partialLinkText()
 By.xpath()
 By.cssSelector()

10. What is XPath?


XPath is a way of identifying elements in a web page. The syntax for XPath is:

Xpath=//tagname[@attribute='value']
Where,
// : Select current node.
Tagname: Tagname of the particular node.
@: Select attribute.
Attribute: Attribute name of the node.
Value: Value of the attribute.

11. What are the different flavors of XPath?


 Absolute XPath
 Relative XPath

12. How do you launch different browsers in selenium web driver?


By instantiating the appropriate browser driver and the using the handle to do
different things in that browser (Ex: Load a URL, finding elements in the web
page etc)

13. How do you clear a text from textbox?


By using clear() method on a web element.
Ex:
If a textbox has been instantiated before and the testBox contains values, then
use, textBox.clear() to clear the values in the test box.

14. What is the difference between close and quit command?

The quit command will kill the driver, driver server and all associated browser
windows whereas the close command only closes the current browser windows
The close command only closes the browser window the driver has focus on.

15. What is implicit wait in Selenium?


Implicit wait time are common to all web elements and has a global timeout
associated with it.

16. How do you refresh browser in selenium?


You cam refresh a browser using refresh command. This is called from the
driver instance of a browser (Ex: driver.navigate().refresh()

17. How can cookies be deleted in Selenium?


Cookies can be deleted by selenium as follows:
 deleteCookie(Cookie cookie)
 deleteAllCookies()
 deleteCookieNamed(String name)

18. What is an explicit wait in Selenium?

Explicit wait times are used if we need to delay the wait time of a particular web
element.

19. How can we check if an element is displayed in a webpage?


By using isDisplayed() method.
Ex: Webelement textBox is a Text Box. If we need to know if the textBox is
displayed then we use textBox.isDisplayed() to verify if the textBox is displayed.
20. How can we check if an element is enabled in a webpage?
By using isEnabled() method

21 Explain about isSelected()method


This method is to check if a particular web element on a webpage is selected
currently.

21. What is the difference between Selenium Grid, Selenium RC and Selenium
Web Driver

22. What is a fluent wait in Selenium?

23. How do you verify tooltip text in Selenium?

24. How do you find all links in a webpage?

25. How do you move to a particular frame in Selenium?

26. How screenshots are captured in Selenium?

27. What is the difference between implicit and explicit waits in Selenium?

28. How do you handle alerts in Selenium?

29. What is a page object model and how do you implement it?

30. What is TestNG?

31. What is data driven testing?

32. How can we run test cases in parallel?

33. What are the different types of tests supported in Selenium?

34. How do you handle popup window in Selenium?

35. Can you explain your understanding of Selenium Grid?

36. Can you explain your understanding of Selenium RC?

37. Can you explain your understanding of Selenium IDE?

38. Can you explain your understanding of Selenium WebDriver?


39. How do you test database assertions in Selenium Web Driver?

40. Explain how Session Handling is done in Selenium?

41.

You might also like