Experience Interview Questions

1) What does SIDE stand for?
Ans: Selenium Integrated Development Environment.

2) What is the difference between an assert and a verify with Selenium commands?
Ans: Assert: Will fail and abort the current test execution.Verify: Will fail and continue to run the test execution.

3) What Selenese commands can be used to help debug a regexp?
Ans:

4) What is one big difference between SilkTest and Selenium, excluding the price?
Ans: I am not sure about Silk Test. But general difference what i found from other Automation Testing tools is that, selenium does not work on Object Repository concept for identifying the objects in the application

5) Which browsers can Selenium IDE be run in?
Ans: FireFox

6) If a Selenium function requires a script argument, what would that argument look like in general terms?
Ans: StoreEval(script, variable) and storeExpression(expression, variableName)

7) If a Selenium function requires a pattern argument, what five prefixes might that argument have?
Ans: glob, regexp, exact, regexpi

8)    What is the regular expression sequence that loosely translates to "anything or nothing?"
 
Ans:     glob: Real* or regexp:Real.*

9)    What is the globbing sequence that loosely translates to "anything or nothing?
 
Ans:    *

10)    What does a character class for all alphabetic characters and digits look like in regular  expressions?
 
Ans:

POSIX
Perl
ASCII
Description
[:alnum:]
[A-Za-z0-9]
Alphanumeric characters
[:word:]
\w
[A-Za-z0-9_]
Alphanumeric characters plus "_"
[:alpha:]
[A-Za-z]
Alphabetic characters
[:digit:]
\d
[0-9]
Digits
[:lower:]
[a-z]
Lowercase letters
[:upper:]
[A-Z]
Uppercase letters








11)    What does a character class for all alphabetic characters and digits look like in globbing?
 
Ans:     [0-9] matches any digit
    [a-zA-Z0-9] matches any alphanumeric character
    [a-zA-Z] matches any alphabet character

12)    What must one set within SIDE in order to run a test from the beginning to a certain point within the test?
 
Ans:     Breakpoint (Keyword: b OR in SIDE, Right click and select “Toggle Breakpoint”)

13)    What does a right-pointing green triangle at the beginning of a command in SIDE indicate?
 
Ans:    Play entire Test suite

14)    How does one get rid of the right-pointing green triangle?
 
Ans:

15)    How can one add vertical white space between sections of a single test?
 
Ans:
 

16)    What Selenium functionality uses wildcards?
 
Ans:    
 

17)    Which wildcards does SIDE support?
 
Ans:     *, [ ]


NOTE: PLEASE  correct me if i am wrong

18)    What are the four types of regular expression quantifiers which we've studied?
 
Ans:

19)    What regular expression special character(s) means "any character?"
 
Ans:    “.*”

20)    What distinguishes between an absolute and relative URL in SIDE?
 
Ans:    Absolute URL: Its is base url and this represent domain address.
           Relative URL: (Absolute URL + Page Path).
          Open command uses Base URL (Absolute URL) to navigate web page.

21)    How would one access a Selenium variable named "count" from within a JavaScript snippet?
 
Ans:    ${count}

22)    What Selenese command can be used to display the value of a variable in the log file, which can  be very valuable for debugging?
 
Ans:    store | Chidambaram | var
          echo  | ${var}

23)    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?
 
Ans:    echo | ${answer}

24)    Where did the name "Selenium" come from?
 
Ans:   
 

25)    Which Selenium command(s) simulates selecting a link?
 
Ans:    click, clickandWait, ClickAt, ClickAtandWait, DoubleClick, DoubleClickandWait, doubleClickAt, doubleClickAtandWait

26)    Which two commands can be used to check that an alert with a particular message popped up?
 
Ans:    The following commands are available within Selenium for processing Alerts:
•    getAlert()
•    assertAlert()
•    assertAlertNotPresent()
•    assertAlertPresent()
•    storeAlert()
•    storeAlertPresent()
•    verifyAlert()
•    verifyAlertNotPresent()
•    verifyAlertPresent()
•    waitForAlert()
•    waitForAlertNotPresent()
•    waitForAlertPresent()
The …AlertPresent() and …AlertNotPresent() functions check for the existence or not of an alert – regardless of it’s content.
The …Alert() functions allow the caller to specify a pattern which should be matched.
The getAlert() method also exists in Selenium RC, and returns the text from the previous Alert displayed.

27)    What does a comment look like in Column view?
 
Ans:     Pink color (Appears only in command column)

28)    What does a comment look like in Source view?
 
Ans:    
 
Command
Target
Value
store
10
hits
storeXpathCount
//blockquote
blockquotes
storeEval
storedVars[‘hits’]-storedVars[‘blockquotes’]
paragraphs

This next example illustrates how a JavaScript snippet can include calls to methods, in this case the JavaScript String object’s toUpperCase method and toLowerCase method.

Command
Target
Value
store
Edith Wharton
name
storeEval
storedVars[‘name’].toUpperCase()
uc
storeEval
storedVars[‘name’].toLowerCase()
lc

JavaScript Usage with Non-Script Parameters
JavaScript can also be used to help generate values for parameters, even when the parameter is not specified to be of type script. However, in this case, special syntax is required–the JavaScript snippet must be enclosed inside curly braces and preceded by the label javascript, as in javascript {*yourCodeHere*}. Below is an example in which the type command’s second parameter value is generated via JavaScript code using this special syntax:

Command
Target
Value
store
league of nations
searchString
type
q
javascript{storedVars[‘searchString’].toUpperCase()}
    Ans is StoredVars[]

43)    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? 
Ans:    ${name}

44)    What is the name of the type of JavaScript entity represented by the last answer?
 
Ans:   
 

45)    What string(s) does this regular expression match? regexp:August|April 5, 1908
Ans:    August 5,1980 or April 5, 1980

46)    What Selenium regular expression pattern can be used instead of the glob below to produce the same results? verifyTextPresent | glob:9512?
Ans:    Glob uses two class pattern : * and []. I am not sure whether question is valid or not.

47)    What Selenium globbing pattern can be used instead of the regexp below to produce the same results? verifyTextPresent | regexp:Hush.*Charlotte
Ans:     glob: Hush*Charlotte

48)    I am using the selenium ide for testing my web application i recorded some script and played back while playing the recorded script the “alert msg is not getting closed”.
Ans:    If the alert message is in different browser you have to handle it after recording. You have to select that popup window and close it.Then transfer the control back to main window.
                 waitForPopUp | winId | 30000
                 selectWindow | winId
                 …
                 close
                 selectWindow
1.What is the difference between Assert and a Verify in Selenium?
2.If a selenium function requires a script argument what would be that argument in general term?
3.If a selenium function requires a pettern argument,what five prefixes might be have?
4.What is the regular expression sequence that loosely translates to “anything or nothing”?
5. What is the globbing expression sequence that loosely translates to “anything or nothing”?
6.What does a character class for all alphabetic characters and digits ?
7.What must one set within SIDE in order to run a test from the beginning to a certain point within the test?
8.What does a right-pointing green triangle at the begging of the command in SIDE indicate?
9.Which wildcards does SIDE support?
10.What are the four types of regular expression quantifiers?
11.What regular expression special character(s) means “any character”?
12.What distinguishes between an absolute and relative URL in SIDE?
13.How would one access a selenium variable named “count” from within a javaScript snippet?
14.What selenese command can be used to display the value of the variable in the log file which can be very valuable for debugging?
15.If one wanted to display the value of a variable named answer in the log file,what would the first argument to the previous commend look like?
16.Which selenium command(s) simulates selecting a link?
17.Which two commends can be used to check that an alert with a particular message popped up?

Suppose u r running a test script with about 600 lines if there is an error in some 482 line then how do you report it to ur lead?
Ans-if any test script fails : (necessary steps needs to fallow )

1. check the exception with line number
2. put a break point , and run test in debug mode
3. check whether test failed becoz of test scripts issue or bug in the App or test data issue , or environment is down

if app issue : raise a defect
if scripts issue : modify ur test script
if test data issue : change the test data in external resource
if environment issue : rerun the test (make sure test script should pass , or else raise a defect (environment setUp issue))


q. How to handle dynamic text box which contains the 3 numbers, get
the number and add the three number and add it other text box?
Ans-public static void main(String[] args) {

WebDriver driver = new FirefoxDriver();
driver.get("file:///C:/Users/Daggupati/Desktop/StringToInt.html");
String value = driver.findElement(By.name("StringTo")).getAttribute("value");

int intValue=0;

for(int i=0; i<=value.length()-1;i++){
intValue += Integer.parseInt(String.valueOf(value.charAt(i)));
}
System.out.println(intValue);
String sendValue = Integer.toString(intValue);
driver.findElement(By.name("IntTo")).sendKeys(sendValue);

}

}
1. What is Selenium?
Selenium is a set of tools that supports rapid development of test automation scripts for web based applications. Selenium testing tools provides a rich set of testing functions specifically designed to fulfill needs of testing of a web based application.

2. What are the main components of Selenium testing tools?
Selenium IDE, Selenium RC and Selenium Grid

3. What is Selenium IDE?
Selenium IDE is for building Selenium test cases. It operates as a Mozilla Firefox add on and provides an easy to use interface for developing and running individual test cases or entire test suites. Selenium-IDE 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.

4. 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.

5. Can tests recorded using Selenium IDE be run in other browsers?
Yes. Although Selenium IDE is a Firefox add on, however, tests created in it can also be run in other browsers by using Selenium RC (Selenium Remote Control) and specifying the name of the test suite in command line.

6. What are the advantage and features of Selenium IDE?
a. Intelligent field selection will use IDs, names, or XPath as needed
b. It is a record & playback tool and the script format can be written in various languages including C#, Java, PERL, Python, PHP, HTML
c. Auto complete for all common Selenium commands
d. Debug and set breakpoints
e. Option to automatically assert the title of every page
f. Support for Selenium user-extensions.js file

7. What are the disadvantage of Selenium IDE tool?
a. Selenium IDE tool can only be used in Mozilla Firefox browser.
b. It is not playing multiple windows when we record it.

8. What is Selenium RC (Remote Control)?
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.

9. What is Selenium Grid?
Selenium Grid in the selenium testing suit allows the Selenium RC solution to scale for test suites that must be run in multiple environments. Selenium Grid can be used to run multiple instances of Selenium RC on various operating system and browser configurations.

10. How Selenium Grid works?
Selenium Grid sent the tests to the hub. Then tests are redirected to an available Selenium RC, which launch the browser and run the test. Thus, it allows for running tests in parallel with the entire test suite.

11. What you say about the flexibility of Selenium test suite?
Selenium testing suite is highly flexible. There are multiple ways to add functionality to Selenium framework to customize test automation. As compared to other test automation tools, it is Selenium’s strongest characteristic. Selenium Remote Control support for multiple programming and scripting languages allows the test automation engineer to build any logic they need into their automated testing and to use a preferred programming or scripting language of one’s choice.

Also, the Selenium testing suite is an open source project where code can be modified and enhancements can be submitted for contribution.

12. What test can Selenium do?
Selenium is basically used for the functional testing of web based applications. It can be used for testing in the continuous integration environment. It is also useful for agile testing

13. What is the cost of Selenium test suite?
Selenium test suite a set of open source software tool, it is free of cost.

14. What browsers are supported by Selenium Remote Control?
The test automation expert can use Firefox, IE 7/8, Safari and Opera browsers to run tests in Selenium Remote Control.

15. What programming languages can you use in Selenium RC?
C#, Java, Perl, PHP, Python, Ruby

16. What are the advantages and disadvantages of using Selenium as testing tool?
Advantages: Free, Simple and powerful DOM (document object model) level testing, can be used for continuous integration; great fit with Agile projects.

Disadvantages: Tricky setup; dreary errors diagnosis; can not test client server applications.

17. What is difference between QTP and Selenium?
Only web applications can be testing using Selenium testing suite. However, QTP 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, QTP is limited to Internet Explorer on Windows.

QTP uses scripting language implemented on top of VB Script. However, Selenium test suite has the flexibility to use many languages like Java, .Net, Perl, PHP, Python, and Ruby.

18. What is difference between Borland Silk test and Selenium?
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.

19. What is the difference between an assert and a verify with Selenium commands?
Effectively an “assert” will fail the test and abort the current test case, whereas a “verify” will fail the test and continue to run the test case.


20. If a Selenium function requires a script argument, what would that argument look like in general terms?
StoreEval(script, variable) and storeExpression(expression, variableName)

21. If a Selenium function requires a pattern argument, what five prefixes might that argument have?
glob, regexp, exact, regexpi

22. What is the regular expression sequence that loosely translates to "anything or nothing?"
(.* i.e., dot star) This two-character sequence can be translated as “0 or more occurrences of any character” or more simply, “anything or nothing.

23. What is the globbing sequence that loosely translates to "anything or nothing?
(*) which translates to “match anything,” i.e., nothing, a single character, or many characters.

24. What does a character class for all alphabetic characters and digits look like in regular expressions?
[0-9] matches any digit
[A-Za-z0-9] matches any alphanumeric character
[A-Za-z] matches any alphabet character


25. What does a character class for all alphabetic characters and digits look like in globbing?
[0-9] matches any digit
[a-zA-Z0-9] matches any alphanumeric character
[a-zA-Z] matches any alphabet character

26. What must one set within SIDE in order to run a test from the beginning to a certain point within the test?
Set Toggle BreakPoint.

27. What does a right-pointing green triangle at the beginning of a command in SIDE indicate?
Play Entire Test Suite

28. Which wildcards does SIDE support?
*, [ ]

29. What are the four types of regular expression quantifiers which we've studied?
Ans : * quantifier: 0 or more of the preceding character (or group)
+ quantifier: 1 or more of the preceding character (or group)
? quantifier: 0 or 1 of the preceding character (or group)
{1,5} quantifier: 1 through 5 of the preceding character (or group)

30. What regular expression special character(s) means "any character?"
(.*)

31. What distinguishes between an absolute and relative URL in SIDE?
Absolute URL: Its is base url and this represent domain address.
Relative URL: (Absolute URL + Page Path).
Open command uses Base URL (Absolute URL) to navigate web page.

32. How would one access a Selenium variable named "count" from within a JavaScript snippet?
${count}

33. What Selenese command can be used to display the value of a variable in the log file, which can be very valuable for debugging?
echo()

34. 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?
echo()

35. Which Selenium command(s) simulates selecting a link?
click, clickandWait, ClickAt, ClickAtandWait, DoubleClick, DoubleClickandWait, doubleClickAt, doubleClickAtandWait

36. Which two commands can be used to check that an alert with a particular message popped up?
The following commands are available within Selenium for processing Alerts:
• getAlert()
• assertAlert()
• assertAlertNotPresent()
• assertAlertPresent()
• storeAlert()
• storeAlertPresent()
• verifyAlert()
• verifyAlertNotPresent()
• verifyAlertPresent()
• waitForAlert()
• waitForAlertNotPresent()
• waitForAlertPresent()
The AlertPresent() and AlertNotPresent() functions check for the existence or not of an alert – regardless of it’s content. The Alert() functions allow the caller to specify a pattern which should be matched. The getAlert() method also exists in Selenium RC, and returns the text from the previous Alert displayed.




No comments:

Post a Comment

Copyright © 2017 QALEARNINGGUIDE.COM || ALL RIGHTS RESERVED