Você está na página 1de 4

elenium Interview Questions and Answers

Sharing Selenium interview questions being asked (to me at various interviews) for Mid-
level to Senior-level Test Engineering positions at well-established companies.

Describe some problems that you had with Selenium tool ?


Solution: The one big limitation in Selenium - Select a file in a File Input field for sake of
uploading.
XPaths makes tests slow
Having Ids for elements make tests faster but the UI code might not have Ids for all
elements
XPaths are brittle - ie flaky because if the UI developer changes anything like adding or
removing a DIV, then the XPath becomes invalid and has to be updated in the tests.
*Also look at my blog above which talks more about File Upload issue with Selenium *

What are the limitations of using Selenium with Flex based UIs ?
Solution: There is a relatively new open source project called FlexUISelenium located
here, which allows Flex based UIs to be tested by Selenium. FlexUISelenium is an
extension to the Selenium RC client driver that enables the Selenium RC client drivers to
interact (and test) the Flex UI components and methods of the Flex application.
FlexUISelenium works on the same lines as the Selenium Flash UI testing concept make
calls to the ActionScript via JavaScript from Selenium.
Pros:

• With FlexUISelenium the developers do not need to expose every method to be


tested by using the ExernalInterface technique.
• Just adding the SeleniumFlexAPI.swc library to the Flex application while
building automatically exposes all methods to be called from external JavaScript.

Cons:

• The FlexUISelenium project is quiet new and has some issues as reported on the
project home page.
• Its not production ready yet and hence not very reliable.
• The developers have to include an external library which is otherwise not required
for production builds.
• How would you test Pop-up window using Selenium ?
• Solution: First steps would be to determine whether this is an alert dialog -created
using JavaScript's alert() or a bona-fide pop up window probably using open().
Since they both are treated differently its important to understand what kind of
test case it is and what exactly interviewee asking.

What is difference between Borland Silk test and Selenium?


Solution: Selenium is completely free test automation tool, while Silk Test is not. Only
web applications can be testing using Selenium testing suite. However, Silk Test can be
used for testing client server applications. Selenium supports following web browsers:
Internet Explorer, Firefox, Safari, Opera or Konqueror on Windows, Mac OS X and
Linux. However, Silk Test is limited to Internet Explorer and Firefox. Silk Test uses
4Test scripting language. However, Selenium test suite has the flexibility to use many
languages like Java, .Net, Perl, PHP, Python, and Ruby.

What is Selenium RC (Remote Control)?


Solution: Selenium RC allows the test automation expert to use a programming language
for maximum flexibility and extensibility in developing test logic. For example, if the
application under test returns a result set and the automated test program needs to run
tests on each element in the result set, the iteration / loop support of programming
language’s can be used to iterate through the result set, calling Selenium commands to
run tests on each item. Selenium RC provides an API and library for each of its supported
languages. This ability to use Selenium RC with a high level programming language to
develop test cases also allows the automated testing to be integrated with the project’s
automated build environment.
More info can be found here

How have you used Selenium for your own most recent project ?
Solution: Make sure you explain about whether you used standard Selenium API to
automate tests, if extended Selenium as per your needs then how have you done that,
besides that which test runner you used with Selenium, also explain about paradigm you
followed for automation using Selenium.
Posted by Shama at 6:16 PM
1.What is the difference between an assert and a verify with Selenium commands?
2.What Selenese commands can be used to help debug a regexp?
3.What is one big difference between SilkTest and Selenium, excluding the price?
4.Which browsers can Selenium IDE be run in?
5.If a Selenium function requires a script argument, what would that argument look like
in general terms?
6.If a Selenium function requires a pattern argument, what five prefixes might that
argument have?
7.What is the regular expression sequence that loosely translates to "anything or
nothing?"
8.What is the globbing sequence that loosely translates to "anything or nothing?
9.What does a character class for all alphabetic characters and digits look like in regular
expressions?
10.What does a character class for all alphabetic characters and digits look like in
globbing?
11.What must one set within SIDE in order to run a test from the beginning to a certain
point within the test?
12.What does a right-pointing green triangle at the beginning of a command in SIDE
indicate?
13. How does one get rid of the right-pointing green triangle?
14. How can one add vertical white space between sections of a single test?
15. What Selenium functionality uses wildcards?
16. Which wildcards does SIDE support?
17. What are the four types of regular expression quantifiers which we've studied?
18. What regular expression special character(s) means "any character?"
19. What distinguishes between an absolute and relative URL in SIDE?
20. How would one access a Selenium variable named "count" from within a JavaScript
snippet?
21. What Selenese command can be used to display the value of a variable in the log file,
which can be very valuable for debugging?
22. If one wanted to display the value of a variable named answer in the log file, what
would the first argument to the previous command look like?
23. Where did the name "Selenium" come from?
24. Which Selenium command(s) simulates selecting a link?
25. Which two commands can be used to check that an alert with a particular message
popped up?
26. What does a comment look like in Column view?
27. What does a comment look like in Source view?
28. What are Selenium tests normally named (as displayed at the top of ch test when
viewed from within a browser)?
29. What command simulates selecting the browser's Back button?
30. If the Test Case frame contains several test cases, how can one execute just the
selected one of those test cases?
31. What globbing functionality is NOT supported by SIDE?
32. What is wrong with this character class range? [A-z]
33. What are four ways of specifying an uppercase or lowercase M in a Selenese pattern?
34. What does this regular expression match?
regexp:[1-9][0-9],[0-9]{3},[0-9]{3}
35. What are two ways to match an asterisk within a Selenese regexp?
36. What is the generic name for an argument (to a Selenese command) which starts
with //?
37. What Selenese command is used to choose an item from a list?
38. How many matches exist for this pattern?
regexp:[13579][02468]
39. What is the oddity associated with testing an alert?
40. How can one get SIDE to always record an absolute URL for the open command's
argument?
41. What Selenese command and argument can be used to transfer the value of a
JavaScript variable into a SIDE variable?
42. How would one access the value of a SIDE variable named name from within a
JavaScript snippet used as the argument to a Selenese command?
43. What is the name of the type of JavaScript entity represented by the last answer?
44. What string(s) does this regular expression match?
regexp:August|April 5, 1908
45. What Selenium regular expression pattern can be used instead of the glob below to
produce the same results?
verifyTextPresent | glob:9512?
46. What Selenium globbing pattern can be used instead of the regexp below to produce
the same results?

Você também pode gostar