Selenium Job Interview Questions and Answers
Selenium Job Interview Questions and Answers
And Answers
If you find any question or answer is incorrect or incomplete then you can submit your question or
answer directly with out any registration or login at our website. You just need to visit Selenium
Interview Questions And Answers to add your answer click on the Submit Your Answer links on the
website; with each question to post your answer, if you want to ask any question then you will have a
link Submit Your Question; that's will add your question in Selenium category. To ensure quality,
each submission is checked by our team, before it becomes live. This Selenium Interview preparation
PDF was generated at Saturday 6th February, 2021
You can follow us on FaceBook for latest Jobs, Updates and other interviews material.
www.facebook.com/InterviewQuestionsAnswers.Org
If you need any further assistance or have queries regarding this document or its material or any of
other inquiry, please do not hesitate to contact us.
Best Of Luck.
Question - 1:
Tell me is it possible to use Selenium for multi-user Load Testing?
ue
Ans:
Yes, but it requires a LOT of hardware. We recommend you check out
BrowserMob, which does load testing with real browsers and is powered by
st
Selenium.
View All Answers
io
Question - 2:
Do you know actual end user simulation, Is the test conducted using this tool
equivalent to an end user action?
ns
Ans:
Selenium performs actions in the background on the browser. It modifies
the DOM structure of the HTML page in order to perform actions on the
page. To be more precise it executes JavaScript on UI objects within the
A
webpage to perform actions like click, type, select etc. This is the
reason why you can execute tests with the browser minimized.
QTP claims to perform end user simulation, in other words executing QTP
ns
Question - 3:
Explain how to configure Selenium RC with eclipse to run Junit Tests?
er
Ans:
1) Download eclipse. click here to download the software
s.
Question - 4:
Explain what is the difference between Thread.Sleep() and Selenium.setSpeed()?
Ans:
Selenium.setSpeed:
1. takes a single argument in string format
ex: selenium.setSpeed("2000") - will wait for 2 seconds
2. Runs each command in after setSpeed delay by the number of
milliseconds mentioned in setSpeed.
Thread.sleep:
1. takes a single argument in integer format
ex: thread.sleep(2000) - will wait for 2 seconds
2. Waits for only once at the command given at sleep.
View All Answers
Question - 5:
Tell me what are the basic annotations used to run TestNG tests in Selenium?
Ans:
In
all the test methods in the current class have been run.
3. @BeforeMethod: The annotated method with @BeforeMethod will be run
before each test method.
rv
Question - 6:
w
Selenium supports Opera and opera is used in most of the Smart phones.
So whichever Smart phone supports opera, selenium can be used to test.
So, one can use Selenium RC to run the tests on mobiles.
ue
Question - 7:
st
effectively, runs the check you specified in your Selenese test script.
View All Answers
ns
Question - 8:
Explain how many testing frameworks can QA Tester use in Selenium RC?
w
Ans:
Testing frameworks aren't required, but they can be helpful if QA Tester
wants to automate test cases. Selenium RC supports Bromine, JUnit,
er
Question - 9:
Do you know why Selenium RC is used?
O
Ans:
We use Selenium RC for:
R
Question - 10:
Suppose if a Selenium function requires a pattern argument, what five
prefixes might that argument have?
Ans:
Five prefixes that Selenium pattern argument are:
glob, regexp, exact, regexpi.
View All Answers
In
Question - 11:
te
Question - 12:
Tell me what is the difference between an assert and a verify with Selenium
w
commands?
Ans:
Assert: Will fail and abort the current test execution.
Q
Question - 13:
what are the Operating Systems supported by Selenium?
st
Ans:
Operating Systems supported by Selenium are:
Selenium IDE
io
3. Linux
4. Solaris
5. Others whichever supports Firefox 2+
Selenium Remote Control
Used for starting browser and run tests
A
3. Linux
4. Solaris
5. Others
Selenium Core
w
2. OS X
3. Linux
4. Solaris
s.
5. Others
View All Answers
O
Question - 14:
Tell me which are the browsers supported by Selenium RC?
R
Ans:
Browsers supported by Selenium RC are:
G
1. firefox
2. mock
3. firefoxproxy
4. pifirefox
5. chrome
6. iexploreproxy
7. explore
8. firefox3
9. safariproxy
10. googlechrome
11. konqueror
12. firefox2
13. safari
14. piiexplore
15. firefoxchrome
16. opera
17. iehta
18. custom
Question - 15:
In
5. AJAX-based UI elements.
View All Answers
w
Question - 16:
Which is the command used for displaying the values of a variable
Q
The command used for displaying the values of a variable into the output
console or logâ€"echo
If you want to display a constant string. The below mentioned command
can be used
echo <constant string>
st
Question - 17:
What are the limitations of Selenium IDE?
Ans:
A
3) Looping statements using is not possible directly in Selenium HTML language in ide
4) Reading from external files like .txt, .xls is not possible
5) Reading from the external databases is not possible with ide
6) Exceptional handling is not there
w
Question - 18:
s.
2. If you need to, commit the user-extensions.js file (like if you use subversion).
3. Open Selenium IDE and choose the Options menu and then Options... from that menu.
4. Make sure the path to your user-extensions.js file is entered in the Selenium Core extensions field (like seleniumcorescriptsuser-extensions.js)
R
Note: After reopen, Selenium IDE may show compilations errors if the user-extensions.js file has any syntax errors.
View All Answers
Question - 19:
What is the difference between captureEntirePageScreenshot and CaptureScreenShot?
Ans:
captureEntirePageScreenshot
1. This captures the AUT web page only
2. This supports only mozilla firefox
3. Accepts two arguments. one is the file name to be saved and other argument is back ground color
CaptureScreenShot
1. This captures the System screen shot
2. This supports all the browsers when you run from Selenium RC
3. Accepts one argument. That is the file name to be saved.
View All Answers
Question - 20:
Which are the commands used for capturing the bitmaps?
Ans:
In
captureEntirePageScreenshot
Saves the entire contents of the current window canvas to a PNG file. Contrast this with the captureScreenshot command, which captureS the contents of the OS
viewport (i.e. whatever is currently being displayed on the monitor), and isimplemented in the RC only. Currently this only works in Firefox when running in chrome
mode, and in IE non-HTA using the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension.
te
viewport (i.e. whatever is currently being displayed on the monitor), and is implemented in the RC only. Currently this only works in Firefox when running in chrome
mode, and in IE non-HTA using the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension.
Please see
captureEntirePageScreenshotAndWait for details.
ie
Note: This command runs with only mozilla firefox when you run the tests from RC. Other browsers it will not support
View All Answers
w
Question - 21:
How to capture bitmaps in Selenium?
Q
Ans:
Bitmaps are captured using the Selenium set of commands. There are two modes of capturing the bitmaps
ue
1) Capture the bitmap for the entire page - it captures the browser main page area of AUT
2) Capture the bitmap for the screen shots - it captures the entire screen shot like the print scree that you give from your keyboard
Selenium doesn't support bitmap capturing for an element on AUT.
View All Answers
st
Question - 22:
When to use Accessors in Selenium?
io
Ans:
Accessors are mostly used for storing the value in a variable.
ns
Question - 23:
What is an Accessor in Selenium?
Ans:
w
Ex: storeTextPresent - Evaluates whether the text is Present in the current window. If the text is present storestrue in the variable else stores false
Ex: storeEementPresent - Evaluates whether the element is present in the current window. If the element is present stores true in the variable else stores false
View All Answers
O
Question - 24:
R
1) assert - If the expected value is mandatory to continue with the next set of steps we will use Assert. As Assert aborts the test, if the expected value doesn't match. It
is good to use for any mandatory checks.
2) verify - If the expected value is optional to continue with the next set of steps we will use Verify. As Verify continues executing with the next set of steps, if the
expected value doesn't match. It is good to use for any optional checks.
3) waitFor - If your test needs to wait, if the expected value is not matching we use waitFor. We normally use waitFor for AJAX kind of controls loading within a
page.
View All Answers
Question - 25:
What are the types of Assertions there in Selenium?
Ans:
Selenium Assertions can be used in 3 modes:
1) assert - When an “assert― fails, the test will be aborted. If you are executing test suite, the next state case will start
2) verify - When a “verify― fails, the test will continue execution, logging the failure.
3) waitFor - “waitFor― commands wait for some condition to become true (which can be useful for testing Ajax applications). They will succeed immediately if
the condition is already true. However, they will fail and halt the test if the condition does not become true within the current timeout setting.
Question - 26:
In
Question - 27:
ie
check points or verification points are known as Assertions in Selenium. The keywords with below mentioned prefix will be used for adding check points or
verification points.
1. verify
2. assert
Q
3. waitFor
View All Answers
ue
Question - 28:
What is Selenese?
Ans:
st
Selenium set of commands which are used for running the test are called as Selenese.
There are three types of Selenese, those are:
1. Actions - used for performing the operations and interactions with the target elements
io
Question - 29:
What are the regular expression patterns available in Selenium?
A
Ans:
Selenium regular expression patterns offer the same wide array of special characters that exist in JavaScript. Below are a subset of those special characters
.
ns
?
quantifier: 0 or 1 of the preceding character (or group)
{1,5}
s.
()
grouping: often used with alternation and/or quantifier
R
Question - 30:
How to use regular expressions in Selenium?
Ans:
Regular expressions in Selenium IDE can be used with the keyword - regexp: as a prefix to the value and patterns needs to be included for the expected values.
For example if you want to use the regular expression for a command
Command: verifyText
Target: //font/font/b/font[1]
Value: Flight Confirmation # 2011-05-02451
in the above example Flight Confirmation is continuously changing each time you run the test case. So this can be writtenwith a regular expression as mentioned
below
Command: verifyText
Target: //font/font/b/font[1]
Value: regexp:Flight Confirmation # [0-9]{4}-[0-9]{2}-[0-9]{5,10}
View All Answers
Question - 31:
What are the types of text patterns available in Selenium?
Copyright © https://InterviewQuestionsAnswers.org Page 8/16
Selenium Interview Questions And Answers
Ans:
There are three types of patterns available in Selenium
1. globbing
2. regular expressions
In
3. exact
View All Answers
te
Question - 32:
Does Selenium support Google Android Operating System?
rv
Ans:
Yes, Selenium Web Driver or Google Web Driver or Selenium 2.0 supports Android Operating System. There are several libraries written to support Android
Operating System.
ie
Question - 33:
Does Selenium support mobile internet testing?
Ans:
Q
Selenium supports Opera. And opera is used in most of the Smart phones. So whichever Smart phone supports opera, selenium can be used to test. So, one can use
Selenium RC to run the tests on mobiles.
ue
View All Answers
Question - 34:
What is the architecture of Selenium Grid?
st
Ans:
Selenium Grid builds on the traditional Selenium setup, taking advantage of the following properties:
io
* The Selenium test, the application under test, and the remote control/browser pair do not have to be co-located. They communicate through HTTP, so they can all
live on different machines.
* The Selenium tests and the web application under test are obviously specific to a particular project. Nevertheless, neither the Selenium remote control nor the
browser is tied to a specific application. As a matter of fact, they provide a capacity that can easily be shared by multiple applications and multiple projects.
ns
Consequently, if only we could build a distributed grid of Selenium Remote Controls, we could easily share it across builds, applications, projects - even potentially
across organizations. Of course we would also need to address the scalability issues as described earlier when covering the traditional Selenium setup. This is why we
need a component in charge of:
* Allocating a Selenium Remote Control to a specific test (transparently)
* Limiting the number of concurrent test runs on each Remote Control
A
regular Remote Control or a Selenium Hub with no code change. It just needs to target a different IP address. This is important as it shields the tests from the grid
infrastructure (which you can scale transparently). This also makes the developer's life easier. The same test can be run locally on a developer machine, or run on a
heavy duty distributed grid as part of a build â€" without ever changing a line of code.
* The Hub allocates Selenium Remote Controls to each test. The Hub is also in charge of routing the Selenese requestsfrom the tests to the appropriate Remote
w
Question - 35:
What is the architecture of Selenium RC?
O
Ans:
The Selenium Server which launches and kills browsers, and acts as an HTTP proxy for browser requests.
R
Client libraries for various programming languages, each of which instructs the Selenium Server in how to test the AUT bypassing it your test script's Selenium
commands.
The diagram shows the client libraries communicate with the Server passing each Selenium command for execution. Then the server passes the Selenium command
G
to the browser using Selenium-Core JavaScript commands. The browser, using its JavaScript interpreter, executes the Selenium command, which effectively, runs the
check you specified in your Selenese test script.
View All Answers
Question - 36:
What are the capabilities of Selenium WebDriver or Google WebDriver or Selenium 2.0?
Ans:
One should use WebDriver when requiring improved support for
• Mult-browser testing including improved functionality for browsers not well-supported by Selenium-1.0.
• Handling multiple frames, multiple browser windows, popups, and alerts.
• Page navigation.
• Drag-and-drop.
• AJAX-based UI elements.
View All Answers
Question - 37:
Copyright © https://InterviewQuestionsAnswers.org Page 9/16
Selenium Interview Questions And Answers
• 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.
rv
Question - 38:
What is Selenium Grid?
w
Ans:
Selenium Grid is part of Selenium suite of projects. Selenium Grid transparently distribute your tests on multiple machines so that you can run your tests in parallel,
cutting down the time required for running in-browser test suites. This will dramaticallyspeeds up in-browser web testing, giving you quick and accurate feedback
you can rely on to improve your web application.
Q
Question - 39:
Which are the languages supported by Selenium RC?
Ans:
st
3. Perl,
4. Python,
5. PHP,
ns
6. Ruby
View All Answers
Question - 40:
A
achieve the above mentioned requirements. Because HTML does not support conditional, looping and external source connectives.
To overcome the above mentioned problems Selenium RC is used.
Since Selenium RC supports the languages .Net, Java, Perl, Python, PHP, and Ruby. In these languages we can write the programme to achieve the IDE issues
O
Question - 41:
What is Selenium RC?
G
Ans:
Selenium-RC is the solution for tests that need a little more than just simple browser actions and a linear execution. Selenium-RC leverages the full power of
programming languages, creating tests that can do things like read and write external files, make queries to a database, send emails with test reports, and practically
anything else a user can do with a normal application.
You will want to use Selenium-RC whenever your test requires logic not supported by running a script from Selenium-IDE
View All Answers
Question - 42:
Which are the Operating Systems supported by Selenium?
Ans:
Selenium IDE
Works in Firefox 2+ Start browser, run tests Run tests
Operating Systems Supported:
1. Windows, 2. OS X 3. Linux 4. Solaris 5. Others whichever supports Firefox 2+
Selenium Remote Control
Used for starting browser and run tests
Question - 43:
Which are the browsers supported by Selenium RC?
rv
Ans:
Supported browsers for Selenium RC include:
(1). *firefox (2). *mock (3). *firefoxproxy (4). *pifirefox ((5). *chrome (6). *iexploreproxy (7). *iexplore (8). *firefox3 (9). *safariproxy (10). *googlechrome (11).
ie
*konqueror (12). *firefox2 (13). *safari (14). *piiexplore (15). *firefoxchrome (16). *opera (17). *iehta
(18). *custom
Note: Any third party browser is supported with *custom followed by the complete path of the browser with executable
w
Question - 44:
Q
Which is the command used for displaying the values of a variable into the output console or log?
Ans:
ue
The command used for displaying the values of a variable into the output console or log - echo
If you want to display a constant string. The below mentioned command can be used
echo <constant string>
ex: echo "The sample message"
st
If you want to display the value of a variable it can be written like below
echo ${<variable name>>
ex: echo ${var1}
io
Question - 45:
How to export Selenium IDE Test Suite to Selenium RC Suites?
Ans:
A
From selenium IDE the test cases can be exported into the languages as mentioned below
1. .Net, 2. Java, 3. Perl, 4. Python, 5. PHP, 6. Ruby
The below mentioned steps can explain how to export the test cases
ns
Question - 46:
How to debug the tests in Selenium IDE?
er
Ans:
To debug or execute the test cases line by line. Follow the below mentioned steps
s.
1. Insert a break point (see the question to know more How to insert a break point in Selenium IDE? ) from the locationwhere you want to execute step by step
2. Run the test case
3. execution will be paused at the given break point
4. Click on the step (Blue) button to continue with the next statement
O
Question - 47:
G
Question - 48:
How to insert a comment in Selenium IDE?
Ans:
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. You need to follow the below mentioned steps.
a. Select the source tab in IDE
Copyright © https://InterviewQuestionsAnswers.org Page 11/16
Selenium Interview Questions And Answers
<td>/node/304/edit&l/td>
<td></td>
-->
te
</tr>
View All Answers
rv
Question - 49:
How to insert a start point in Selenium IDE?
ie
Ans:
Start point Selenium IDE can be set in two ways
1. Right click on the command in Selenium IDE and select "Set / Clear Start Point"
w
2. Select the command in Selenium IDE and press "S" key on the keyboard
3. You can have only one start point
4. If you have already set one start point and you selected other command as start point. Then the first start point will be removed and the new start point will be set
Q
Question - 50:
ue
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
io
View All Answers
Question - 51:
ns
Question - 52:
w
Question - 53:
What are the capabilities of Selenium IDE?
Ans:
Selenium IDE (Integrated Development Environment) works similar to commercialtools like QTP, Silk Test and Test Partner etc. The below mentioned 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
View All Answers
Question - 54:
What are the test types supported by Selenium?
Ans:
In
Selenium could be used for testing the web based applications. The test types can be supported are: 1. functional, 2. regression, 3. load testing
The automation tool could be implemented for post release validation withcontinuous integration tools like:
1. Jenkins,
2. Hudson,
te
3. QuickBuild,
4. CruiseCont
View All Answers
rv
Question - 55:
ie
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
Q
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
ue
Question - 56:
What do you know about Selenium?
io
Ans:
Selenium is a suite of tools for web automation testing.
ns
Selenium first came to life in 2004 when Jason Huggins was testing an internalapplication at ThoughtWorks.
Selenium was a tremendous tool, it wasn't without it's drawbacks. Because of its Javascript based automation engine and the security limitations browsers apply to
Javascript, different things became impossible to do.
Selenium Suite of projects include:
Selenium IDE
A
Selenium Core
Selenium 1 (known as. Selenium RC or Remote Control)
Selenium 2 (known as. Selenium Webdriver)
ns
Selenium-Grid
View All Answers
w
Question - 57:
Selenium vs Dejaclick?
er
Ans:
Dejaclick is probably the best (free) macro tool for websites record and play. However Selenium beats DejaClick in overall features(multiple language suport vs only
XML support, free automation vs paid automation).
s.
Dejaclick Advantage:
It nicely plays back the recorded stuff - by highlighting appropriate items in green.
It can easily record flash/silverlight - by recording position.(however it may mean that it may not
nicely work in all computers)
O
Dejaclick recording tool is free - But for automation you have to rely on paid site alertsite (AlertSite however provides great facility for running your dejaclick script
and even soap xml from most of cities/region in US/world. This will allow you to monitor your CDN performance/reliability or what content your website is serving
across different regions)
View All Answers
Question - 58:
Can you please explain Selenium vs Imacros?
Ans:
Imacros appeared better in recording. But overall its not as powerful for automation(or scheduling).
View All Answers
Question - 59:
Explain Selenium vs Watir?
Ans:
If you like your test cases in Ruby (or maybe .net) and are willing to
Copyright © https://InterviewQuestionsAnswers.org Page 13/16
Selenium Interview Questions And Answers
Question - 60:
Explain Selenium vs Low/Network level tools like Webtest/HttpUnit/HtmlUnit(java)?
ie
Ans:
If you are using a "low/network" level tool like htmlunit then it
w
it for monitoring - but don't use those tools for browser/regression testing.
View All Answers
ue
Question - 61:
Tell me do I Export in HTML or do I export in programming language like java client?
st
Ans:
If you need dynamic capability (e.g. reading data from csv file or database) then
you have to export it in programming language like java.
io
You would also need to export in java - if your page has lots of flash
components. e.g.
http://www.adobe.com/devnet/flash/articles/flash_selenium_04.html
ns
There is also attempt to make silverlight work with java and .net out here.
The client code using java also is more stable (less permission denied errors) then
the html case.
But the html is easy to modify/maintain and it generates nice results - whereas in
java client code it tends to be cryptic(but again html test case - does not seem to be flexible).
A
Question - 62:
Tell me who should use Selenium?
Ans:
w
Developers can use it - for “browser― regression testing ( and replace htmlunit/httpunit in some cases) .
Per the one of the forces behind selenium(Neal ford) - it should really be used by Business Analyst first .
QA should enhance/use it do regression test/cross browsers testing on all platforms .
er
Question - 63:
s.
Question - 64:
Explain how does Selenium remote control internally works?
Ans:
Selenium RC launches the browser with itself as the proxy server (hence you may get certificate warning in some modes) and then it injects javascript - to play the
test. This also means it can easily work in ALL browsers/platform - and it can be easily used to test AJAX(unlike professional tools).
View All Answers
Question - 65:
Explain what are the components of selenium?
Ans:
Selenium IDE - Plugin to Firefox to record and play test in firefox
and also export tests in different languages. The most appealing
format is the html test case which seems to based on fit html .
Copyright © https://InterviewQuestionsAnswers.org Page 14/16
Selenium Interview Questions And Answers
Question - 66:
Do you know what does selenium do?
te
Ans:
You can use opensource(ie free!) - Selenium tool ( selenium IDE is a plugin to firefox) to record and playback tests (like WinRunner, QTP). You can then export the
recorded test in most language e.g. html, Java , .net , perl , ruby etc. The exported test can be run in any browser and any platform using "selenium remote control".
rv
Follow us on FaceBook
www.facebook.com/InterviewQuestionsAnswers.Org
Follow us on Twitter
https://twitter.com/InterviewQA