Monday, December 8, 2014

Selenium Interview Question with Answers

Selenium interview questions with answers
Common Selenium interview question with answers can be found on this site. Being Senior QA Tester, I started to put together and continuously update interview question for Selenium test automation tool. These questions were asked during real QA interviews for Selenium QA Automation Engineer position in the leading companies. I believe that any QA Engineer, no matter seasoned one or novice one, would greatly benefits from this collection Selenium interview questions and tips. If you are plan to attend an interview you need to know the answers on these Selenium questions by heart. I provided answers on several technical interview questions, but you have to think how you would personally answer these questions. Finally, I would ask anyone of you to provide answers on unanswered Selenium interview question, so we all would benefit from this knowledge sharing and it would help us to land on Selenium QA Automation Engineer job and work successfully. If you were asked the interview question that is not in the list, post it with your answer.

Common Selenium interview questions for QA Engineers

HERE ARE THE SELENIUM INTERVIEW QUESTIONS:
Last updated on October 1, 2014

  • What is Selenium?
  • Selenium is a suite of tools for browser automation. It is composed of "IDE", a recording and playback mechanism, "WebDriver" and Remote Control "RC" which provide APIs for browser automation in a wide variety of languages, and "Grid", which allows many tests using the APIs to be run in parallel. QA Tester should not forget to mention during interview that with the release of Selenium 2, Selenium RC has been officially deprecated in favor of Selenium WebDriver. It works with most browsers, including Firefox 3.6 and the last, latest and next release of Firefox (currently Firefox 17-19); Internet Explorer 6 and up; Google Chrome; Safari 4 and 5; Android Ice Cream Sandwich and onward; and Opera 11.6+.

  • Describe technical problems that you had with Selenium tool?
  • As with any other type of test automation tools like SilkTest, HP QTP, Watir, Canoo Webtest, Selenium allows to record, edit, and debug tests cases. However there are several problems that seriously affect maintainability of recorded test cases, occasionally Quality Assurance Engineers complain that it takes more time to maintain automated test cases than to perform manual testing; however this is an issue with all automated testing tools and most likely related to improper testing framework design. Another problem is complex ID for an HTML element. If IDs is auto-generated, the recorder test cases may fail during playback. The work around is to use XPath to find required HTML element. Selenium supports AJAX without problems, but QA Tester should be aware that Selenium does not know when AJAX action is completed, so ClickAndWait will not work. Instead QA tester could use pause, but the snowballing effect of several 'pause' commands would really slow down total testing time of test cases. The best solution would be to use waitForElement.




  • What test can Selenium do?
  • Selenium could be used for the functional, regression, load testing of the web based applications. The automation tool could be implemented for post release validation with continuous integration tools like Jenkins, Hudson, QuickBuild or CruiseControl.

  • What is the price of Selenium license per server?
  • Selenium is open source software, released under the Apache 2.0 license and can be downloaded and used without charge.

  • How much does Selenium license cost per client machine?
  • Selenium is open source software, released under the Apache 2.0 license and can be downloaded and used without charge.

  • Where to download Selenium?
  • Selenium can be downloaded and installed for free from seleniumhq.org

  • What is the latest version of Selenium components?
  • The latest versions are Selenium IDE 2.5.0, Selenium Server (formerly the Selenium RC Server) 2.42.2, The Internet Explorer Driver Server 2.42.2, Selenium Client Drivers Java 2.42.2, Selenium Client Drivers C# 2.42.0, Selenium Client Drivers Ruby 2.42.0, Selenium Client Drivers Python 2.42.1, Selenium Client Drivers Javascript (Node) 2.42.0

  • What is Selenium IDE?
  • Selenium IDE is a Firefox add-on that records clicks, typing, and other actions to make a test cases, which QA Tester can play back in the Firefox browser or export to Selenium RC. Selenium IDE has the following features: record/play feature, debugging with step-by-step and breakpoints, page abstraction functionality, an extensibility capability allowing the use of add-ons or user extensions that expand the functionality of Selenium IDE
Selenium

  • What are the limitations of Selenium IDE?
  • Selenium IDE has many great features and is a fruitful and well-organized test automation tool for developing test cases, in the same time Selenium IDE is missing certain vital features of a testing tool: conditional statements, loops, logging functionality, exception handling, reporting functionality, database testing, re-execution of failed tests and screenshots taking capability. Selenium IDE doesn't for IE, Safari and Opera browsers.

  • What does SIDE stand for?
  • Selenium IDE. It was a very tricky interview question.

  • What is Selenium Remote Control (RC) tool?
  • Selenium Remote Control (RC) is the powerful solution for test cases that need more than simple browser actions and linear execution. Selenium-RC allows the developing of complex test scenarios like reading and writing files, querying a database, and emailing test reports. These tasks can be achieved by tweaking test cases in your preferred programming language. Selenium RC has been officially deprecated in favor of Selenium WebDriver.

  • What are the advantages using Selenium as testing tool?
  • If QA Tester would compare Selenium with HP QTP or Micro Focus SilkTest, QA Engineer would easily notice tremendous cost savings for Selenium. In contrast to expensive SilkTest license or QTP license, Selenium automation tool is absolutely free. It means that with almost no investment in purchasing tools, QA Team could easily build the state of the art test automation infrastructure. Selenium allows developing and executing test cases in various programming languages including .NET, Java, Perl, RubyPython, PHP and even HTML. This is a great Selenium advantage, most likely your software developers already know how to develop and maintain C# or Java code, so they transfer coding techniques and best practices to QA team. Selenium allows simple and powerful DOM-level testing and in the same time could be used for testing in the traditional waterfall or modern Agile environments. Selenium would be definitely a great fit for the continuous integration tools Jenkins, Hudson, CruiseControl, because it could be installed on the server testing box, and controlled remotely from continuous integration build.




  • What is Selenium Grid?
  • Selenium Grid extends Selenium RC to distribute your tests across multiple servers, saving you time by running tests in parallel.

  • What is Selenium WebDriver?
  • Selenium WebDriver is a tool for writing automated tests of websites. It is an API name and aims to mimic the behavior of a real user, and as such interacts with the HTML of the application. Selenium WebDriver is the successor of Selenium Remote Control which has been officially deprecated.

  • How many browsers are supported by Selenium IDE?
  • Test Engineer can record and playback test with Selenium IDE in Firefox.

  • Can Selenium test an application on iPhone's Mobile Safari browser?
  • Selenium should be able to handle Mobile Safari browser. There is experimental Selenium IPhone Driver for running tests on Mobile Safari on the iPhone, iPad and iPod Touch.

  • Can Selenium test an application on Android browser?
  • Selenium should be able to handle Android browser. There is experimental Selenium Android Driver for running tests in Android browser.

  • What are the disadvantages of using Selenium as testing tool?
  • Selenium weak points are tricky setup; dreary errors diagnosis; tests only web applications

  • How many browsers are supported by Selenium Remote Control?
  • QA Engineer can use Chrome, Firefox, IE, Safari and Opera browsers to run actual tests in Selenium RC.

  • How many programming languages can you use in Selenium RC?
  • Several programming languages are supported by Selenium Remote Control - C# Java Perl PHP Python Ruby

  • How many testing framework can QA Tester use in Selenium RC?
  • Testing frameworks aren't required, but they can be helpful if QA Tester wants to automate test cases. Selenium RC supports Bromine, JUnit, NUnit, RSpec (Ruby), Test::Unit (Ruby), TestNG (Java), unittest (Python).

  • How to developer Selenium Test Cases?
  • Using the Selenium IDE, QA Tester can record a test to comprehend the syntax of Selenium IDE commands, or to check the basic syntax for a specific type of user interface. Keep in mind that Selenium IDE recorder is not clever as QA Testers want it to be. Quality assurance team should never consider Selenium IDE as a "record, save, and run it" tool, all the time anticipate reworking a recorded test cases to make them maintainable in the future.

  • What programming language is best for writing Selenium tests?
  • The web applications may be written in Java, Ruby, PHP, Python or any other web framework. There are certain advantages for using the same language for writing test cases as application under test. For example, if the team already have the experience with Java, QA Tester could always get the piece of advice while mastering Selenium test cases in Java. Sometimes it is better to choose simpler programming language that will ultimately deliver better success. In this case QA testers can adopt easier programming languages, for example Ruby, much faster comparing with Java, and can become become experts as soon as possible.

  • Have you read any good books on Selenium?
  • There are several great books covering Selenium automation tool, you could check the review at Best Selenium Books: Top Recommended page


  • Do you know any alternative test automation tools for Selenium?
  • Selenium appears to be the mainstream open source tool for browser side testing, but there are many alternatives. Canoo Webtest is a great Selenium alternative and it is probably the fastest automation tool. Another Selenium alternative is Watir, but in order to use Watir QA Tester has to learn Ruby. One more alternative to Selenium is Sahi, but is has confusing interface and small developers community.


  • Compare HP QTP vs Selenium?
  • When QA team considers acquiring test automation to assist in testing, one of the most critical decisions is what technologies or tools to use to automate the testing. The most obvious approach will be to look to the software market and evaluate a few test automation tools. Read Selenium vs QTP comparison




So, if you are QA Tester serious about a career in software engineering field and you do not know anything about programming language like Java, Ruby, Python, JavaScript, learn one. However, you should be adept in automation technologies and for obvious reasons, you have to get Selenium WebDriver skills.


Selenium IDE interview question

Is Selenium IDE a good choice for automated testing? Even QA Testers, who only started to work with Selenium, know that Selenium IDE is an integrated development environment for Selenium scripts implemented as a Firefox extension. It helps to perform some automated functional browser testing and allows QA Tester to record, edit, and debug tests. Selenium IDE is a great tool for simple test cases and not that suitable for complex scenarios, where it would be better to use Selenium Webdriver. In the same time IDE could be used for trivial automation testing, to repeat some routine and lightweight tasks that let your web application ready to be tested.

Selenium 2 Testing Tools: Beginner's Guide - Book Review

Selenium 2 Testing Tools: Beginner's Guide book review should be started with the author introduction: David Burns is a Senior Software Engineer in Test at Mozilla Corporation and has been doing test automation for many years. David is a Core Committer at Selenium Open Source Community and familiar with the tricks and issues that go with Selenium 2. After the success of the first edition of the book, David updated the wrote the second edition of this book in a fast-paced but friendly and engaging approach.

Selenium 2 Testing Tools: Beginner's Guide: Beginner's Guide will help QA Tester start with testing web applications using Selenium from scratch. It covers the wide variety of topics from setting up the Java environment to running tests on mobile devices, it contains all the information to get a beginner up and running on using Selenium 2. An essential overview of the WebDriver is presented next followed by migrating test cases from Selenium RC to Selenium WebDriver. Once all the tests have been created the book guides how QA Tester can speed up the execution of automated test cases by running them in parallel and reduce build time using Selenium Grid. The book is created in the guide style which emphasizes the concept of learning by doing and it is full of examples and code samples.


Selenium 2 Webdriver vs QTP

Update April 2013 I have recently posted a more up-to-date comparison between QTP and Selenium

There are many articles which compare Selenium 2 Webdriver with HP QTP and I want to add a one more valid comparison measurement - jobs
Just look at Selenium vs QTP job posting trends from Indeed.com above. Selenium jobs continue to explode and Selenium now garners more job postings than HP QTP

What is the best programming language for Selenium 2 ?

The tough Selenium 2 interview questions for QA Manager : Imagine that you have decided to do test automation for web based application using Selenium 2. What would be the best language to learn along with Selenium 2 for the team of QA Testers?

As a candidate for QA Manager I would start this way:

This choice is a little bit simpler for Selenium 2 than Selenium, because Selenium 2 supports Java, Ruby, C#, and Python, but does not yet support Perl or PHP. Obviously you have to choose only from four languages and there are several factors to consider.

Introducing a new language to a team isn't an easy task. The best choice will be to use a language QA Testers are familiar with. Learning Selenium 2 and learning a new programming language is a lot tougher than learning just Selenium 2.

Next things to consider is the local support for the programming language. For example, if local developers already have an experience with Java, this language might be a better choice for QA Testers. If the tester needs help with the language, the development tools, the defects then leverage in-house expertise would be much better.

In general the language you'll get the most out of Selenium 2 is Java, because the Java client code is the first developed and the standard for correctness. For example HtmlUnit Driver, fastest and most lightweight implementation of WebDriver, would require Selenium Server for any language binding other than Java.





No comments:

Post a Comment