Selenium FAQs

Selenium Automation testing Most Frequently Asked Questions with Answers:

In our Selenium online training course, we get many queries on Selenium and automation testing. We thought it will be good if we list these frequently asked questions on one page for your handy reference.

=> If you are interested in more Selenium interview questions please visit this page.
=> Also check out these free Selenium training text tutorials.

selenium training

Selenium FAQs

Q#1. What is Selenium 1.0 and Selenium 2.0?
Ans. Selenium 1.0 is also known as Selenium RC, and Selenium 2.0 is also known as Selenium Webdriver. Selenium RC is an approach where a browser is automated by injecting a java script and commands are driven by sending them to a server. Where as in the, Webdriver the browser API is extended to drive the browser.

Q#2. Why do we need webdriver when we have IDE available?
Ans. Selenium IDE is only an XPI package or add on of firefox. It was created for the sole purpose of providing record and replay of selenium test scenarios so that test automation script generation using client drivers becomes much faster as IDE also allows one to save test in other formats. Also you cannot perform logical flows, parameterization and other such limitations exists with IDE.

Q#3. What all browsers are supported by Webdriver?
Ans. Internet explorer, firefox, safari, chrome, opera are all supported by webdriver.

Q#4. Is it true that if an object is identified using XPath then, my tests can break if I execute them on a separate browser?
Ans. Yes, each browser identifies an object using xpath slightly differently. For more information on it, read this link-

Q#5. Can we program webdriver in any other language then Java?
Ans.Yes webdriver support variety of programming languages like C#, ruby, perl, python etc. For more read here –

Q#6. How can I configure proxy, if I need to?
Ans. Using the desired capabilities class, one can achieve that.

Code snippet-
Proxy proxy = new Proxy();

// We use firefox as an example here.
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability(CapabilityType.PROXY, proxy);

// You could use any webdriver implementation here
WebDriver driver = new FirefoxDriver(capabilities);

Q#7. How much Java should I know before I start learning webdriver ?
Ans. You should know basic java programming language and OOPs concept familiarity should be there to start using webdriver with Java.

Q#8. How can we handle popup and alerts?
Ans. Popup and alert are windows, as in new windows the way java sees them. To handle them first you have to get the window handle, and once you have that available, you need to use the switchTo() command to handle the opened window.


Q#9. How can you do cross browser testing with webdriver?
Ans. Webdriver supports multiple browsers and operating systems. To perform cross browser testing, one would need support of Selenium Grid. To understand how to setup grid for this activity, this link is useful –

Q#10. Which unit test framework should be used with Webdriver, Junit or TestNG?
Ans. TestNg should be used with webdriver, as JUnit framework has limitations when looking from the view point of testing. TestNG is a more suitable unit test framework available for testing needs.

Q#11. Is it possible to generate custom reports with webdriver?
Ans. Yes, with TestNG using the listener annotation where in you implement the ITestListener and Test Adapater class, custom reporting is feasible.

Q#12. Can you access database with webdriver?
Ans. No, you cannot access database with webdriver, since it is a library file create to drive the browser. But one can use java easily to access the database, using either java.sql or jdbc methodology.

Q#13. Is there any selenium support available to users of selenium?
Ans. Yes, and a lot of support is available out there. Selenium is the most popular open source testing tool available in the market. It has got a dedicated selenium user google group. And besides that lots of groups are available on the professional networking platform linked in.

Q#15. What is Page Object Model?
Ans. Page Object model is a concept of programming or an approach to the test automation, which helps in managing and creating a robust test automation suite. To know more about it, read this link-

Q#16. What is Desired Capabilities and why do we need it with webdriver?
Ans. Desired capabilities is a class, which helps to set up different properties of browser, server, OS during the test automation run. Link-

Q#17. How can I uniquely identify an html object when more than one exists in a web page having the same set of properties.?
Ans. You have to take the approach of XPath in here. For e.g. let us say there are two test boxes, both having the name property say – text1. Then if you identify it using, it will also return the first text box. If you wish to execute on other textbox, the xpath should look like this –


Q#18. What is a hybrid framework?
Ans. A hybrid framework is one the most common framework implementations found with selenium. A hybrid framework is one in which the script is modularized and data is managed.

Q#19. Are there frameworks over selenium available?
Ans. Yes, many commercial frameworks are available over selenium. You can either create one yourself, or even buy from the market.

Q#20. Why selenium is a popular open source test solution for automation?
Ans. Selenium is popular, because it is the most powerful test automation solution available in the market for web applications testing. It supports multiple browsers, operating system and multiple languages to help you code. Selenium also provides its multiple components to address different challenges of test automation. Organizations both small and big are using selenium as there defacto choice for test automation.