Selenium Q& A part -2

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s