Selenium Interview Questions
1) What is Selenium IDE?
Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and has a recording feature, which will keep account of user actions as they are performed and store them as a reusable script to play back. Selenium-IDE also offers full editing of test cases for more precision and control.
2) Can Selenium test a application on iPhone’s Mobile Safari browser?
Selenium can handle Mobile Safari browser. There is experimental Selenium IPhone Driver for running tests on Mobile with Safari on the iPhone and iPad and iPod Touch.
3) Can Selenium test an application on Android browser?
Selenium can handle Android browser.
4) What tests can selenium do?
Selenium could do functional, regression, and load of web based applications.
5) What are the disadvantages of Selenium?
Disadvantages of Selenium:
• Limitation in terms of browser support (It runs only in Mozilla).Scripts written using Selenium IDE can be used for other browsers only if it is used with Selenium RC or Selenium Core.
• We can’t run recorded script if it is converted to Java, C#, Ruby etc.
• Not allowed to write manual scripts like conditions and Loops for Data Driven Testing
• There is no option to verify images.
6) What are the technical challenges with selenium?
As you know Selenium is a free ware open source testing tool. There are many challenges with Selenium.
1. Selenium supports only web based applications.
2. It doesn’t support any non web based (Like Win 32, Java Applet, Java Swing, .Net Client Server etc) applications.
3. When you compare selenium with QTP, Silk Test, Test Partner and RFT, there are many challenges in terms of maintainability of the test cases.
4. Since Selenium is a freeware tool, there is no direct support if one is in trouble with the support of applications.
5. There is no object repository concept in Selenium, so maintainability of the objects is very high
6. There are many challenges if one have to interact with Win 32 windows even when you are working with Web based applications.
7. Bitmap comparison is not supported by Selenium.
8. Any reporting related capabilities, you need to depend on third party tools.
9. You need to learn any one of the native language like (.Net, Java, Perl, Python, PHP, Ruby) to work efficiently with the scripting side of selenium.
7) How to run test case recorded using Selenium IDE in other browsers?
Running test case recorded with the help of Selenium -Remote Control.
8) What is the selenium’s recording language?
Selenium’s recording language is “HTML”.
9) What are the steps to run automation using selenium?
The very basic steps are:
1. Record the test steps using selenium-IDE.
2. Modify the script according to the testing needs. Add validation points, Java Scripts, Time-out etc.
3. Run the test.
4. View the result after test run complete analyze.
10) What are the capabilities of Selenium IDE?
Selenium IDE (Integrated Development Environment) works similar to commercial tools like QTP, Silk Test and Test Partner etc.
The below points describes well about Selenium IDE.
1. Selenium IDE is a Firefox add-on.
2. Selenium IDE can support recording the clicks, typing, and other actions to make a test cases.
3. Using Selenium IDE, a tester can play back the test cases in the Firefox browser.
4. Selenium IDE supports exporting the test cases and suites to Selenium RC.
5. Debugging of the test cases with step-by-step can be done.
6. Breakpoint insertion is possible.
7. Page abstraction functionality is supported by Selenium IDE.
8. Selenium IDE can supports an extensibility capability allowing the use of add-ons or user extensions that expand the functionality of Selenium IDE.
11) What are the challenges with Selenium IDE?
Selenium-IDE does not directly support:
1. condition statements
2. iteration or looping
3. logging and reporting of test results
4. error handling, particularly unexpected errors
5. database testing
6. test case grouping
7. re-execution of failed tests
8. test case dependency
9. capture screenshots on test failures
10. Results Report generations
12) How to execute a single line command from Selenium IDE?
Single line command from Selenium IDE can be executed in two ways
1. Right click on the command in Selenium IDE and select “Execute This Command”.
2. Select the command in Selenium IDE and press “X” key on the keyboard.
13) What is Selenium Remote Control?
Selenium-RC is the solution for tests that need more than simple browser actions and linear execution. We can use Selenium-RC whenever our test requires logic which is not supported by Selenium-IDE.
Selenium-RC uses the full power of programming languages to create more complex tests like reading and writing files, querying a database, and emailing test results.
14) What are the advantages of Selenium?
Advantages of Selenium:
• It is a Open source.
• Simple, Easy to install, Easy to work.
• Selenium IDE is the only flavor of Selenium which allows you to record user action on browser window.
• Can also record user actions in most of the popular languages like Java, C#, Perl, Ruby.
• It will not record any operation that you do on your computer apart from the events on Firefox browser window.
• During recording if you right click on any element it will show all the selenium commands available.
• we can also edit existing command, by selecting it and editing on the boxes available.
• we can also insert/delete commands by choosing appropriate option after right clicking.
• Choose appropriate run option – i.e walk, run or test runner and review your results.
15) How to Use Selenium?
We can use the selenium by selecting “Selenium IDE” from the Tools menu in Firefox.
By default when the IDE comes up it has recording turned on. Go to a web site that you want to record, click on the record button and begin the browsing task(s). we will notice that as we click and type in the browser the IDE is recording everything we are doing. When we are done, simply end recording and click on the green arrow to play back the script you just created. Don’t forget to save your script before closing the IDE.
16) What are the Selenium components?
There are three variants of Selenium, which can be used in isolation or in combination to create complete automation suite for the web applications. Each one has a specific role in aiding the development of web application test automation.
• Selenium IDE
• Selenium Core
• Selenium RC
17) How to export the tests from Selenium IDE to Selenium RC in different languages?
From selenium IDE, the test cases can be exported into the languages
The below mentioned steps can explain how to export the test cases:
1. Open the test case from Selenium IDE.
2. Select File -> Export Test Case As.
18) How to insert a break point in Selenium IDE?
Break point can be set in two ways in Selenium IDE:
1. Right click on the command in Selenium IDE and select “Toggle Break Point”.
2. Select the command in Selenium IDE and press “B” key on the keyboard.
3. If you want to clear the break point once again press “B” key on the keyboard.
4. You can set multiple break points in Selenium IDE.
19) How to insert a comment in Selenium IDE?
Comments in Selenium IDE can be set in two ways.
1. Right click on the command in Selenium IDE and select “Inert New Comment”.
2. If you want to comment an existing line, we need to follow the below mentioned steps.
a. Select the source tab in IDE.
b. Select the line which you want to comment.
c. Assume that if you want to comment a open command you need to write like below mentioned code
20) What is Selenium server default port number?
Selenium server default port number is 4444.
21) How to run Selenium server, other than the default port 4444?
We can run Selenium server on java -jar selenium-server.jar -port.
22) How do you check a single test method in multiple browser?
We can check a single test method in multiple browsers by using Selenium Grid.
23) How do you identify an object using selenium?
We can identify an object using selenium with:
isElementPresent takes a locator as the argument and if found returns a boolean value of True.
24) How do you handle Ajax controls using selenium?
We can handle Ajax controls by using wait for condition command.
25) What is Selenium WebDriver or Google WebDriver or Selenium 2.0?
WebDriver’s goal is to provide an API that establishes
• A well-designed standard programming interface for web-app testing.
• Improved consistency between browsers.
• Additional functionality addressing testing problems not well-supported in Selenium 1.0.
The Selenium developers strive to continuously improve Selenium. Integrating WebDriver is another step in that process. The developers of Selenium and of WebDriver felt they could make significant gains for the Open Source test automation community be combining forces and merging their ideas and technologies. Integrating WebDriver into Selenium is the current result of those efforts.
26) Explain about Selenium the Open Source Testing Tool for web application?
Selenium the OpenSource Testing Tool for web application:
Selenium is a portable software testing framework for web applications. Selenium provides a record/playback tool for authoring tests without learning a test scripting language. Selenium provides a test domain specific language (DSL) to write tests in a number of popular programming languages, including Java, Ruby, Groovy, Python, PHP, and Perl. Test playback is possible in most modern web browsers. Selenium deploys on Windows, Linux, and Macintosh platforms.
Selenium was originally developed by Jason Huggins, who was later joined by other programmers and testers at ThoughtWorks. It is open source software, released under the Apache 2.0 license and can be downloaded and used without charge. The latest side project is Selenium Grid, which provides a hub allowing the running of multiple Selenium tests concurrently on any number of local or remote systems, thus minimizing test execution time.
27) What is the use of context menu in Selenium IDE?
It allows the user to pick from a list of assertions and verifications for the selected location.
28) Explain about Selenium RC Java client libraries?
29) Explain about Selenium Server?
Selenium Server receives Selenium commands from your test program, interprets them, and reports back to your program the results of running those tests.
30) Why use TestNG with Selenium RC ?
Using TestNG with Selenium RC:
Selenium IDE by itself is great for creating test cases and executing single tests. TestRunner is ok at running a test suite. But if you want full automation against different server and client platforms, you need a way to invoke the tests from a command line process, flexibility in how you create your test suites, and reports that tell you what happened. TestNG provides these features. You can use Selenium RC with other languages as well, but since Sakai is written in Java it makes sense to stick with the language most of us are familiar with already.