Search This Blog

Wednesday, August 4, 2010

What is Selenium Core

Selenium Core: Selenium Core 0.8.3 Reference
Concepts
A command is what tells Selenium what to do. Selenium commands come in three 'flavors': Actions, Accessors and Assertions. Each command call is one line in the test table of the form:
command target value
Actions are commands that generally manipulate the state of the application. They do things like "click this link" and "select that option". If an Action fails, or has an error, the execution of the current test is stopped.
Many Actions can be called with the "AndWait" suffix, e.g. "clickAndWait". This suffix tells Selenium that the action will cause the browser to make a call to the server, and that Selenium should wait for a new page to load.
Accessors examine the state of the application and store the results in variables, e.g. "storeTitle". They are also used to automatically generate Assertions.
Assertions are like Accessors, but they verify that the state of the application conforms to what is expected. Examples include "make sure the page title is X" and "verify that this checkbox is checked".
All Selenium Assertions can be used in 3 modes: "assert", "verify", and "waitFor". For example, you can "assertText", "verifyText" and "waitForText". When an "assert" fails, the test is aborted. When a "verify" fails, the test will continue execution, logging the failure. This allows a single "assert" to ensure that the application is on the correct page, followed by a bunch of "verify" assertions to test form field values, labels, etc.
"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 (see the setTimeout action below).
Element Locators tell Selenium which HTML element a command refers to. Many commands require an Element Locator as the "target" attribute. Examples of Element Locators include "elementId" and "document.forms[0].element". These are described more clearly in the next section.
Patterns are used for various reasons, e.g. to specify the expected value of an input field, or identify a select option. Selenium supports various types of pattern, including regular-expressions, all of which are described in more detail below.
Defines an object that runs Selenium commands.
Element Locators
Element Locators tell Selenium which HTML element a command refers to. The format of a locator is:
locatorType=argument
We support the following strategies for locating elements:
• identifier=id: Select the element with the specified @id attribute. If no match is found, select the first element whose @name attribute is id. (This is normally the default; see below.)
• id=id: Select the element with the specified @id attribute.
• name=name: Select the first element with the specified @name attribute.
o username
o name=username
The name may optionally be followed by one or more element-filters, separated from the name by whitespace. If the filterType is not specified, value is assumed.
o name=flavour value=chocolate
• dom=javascriptExpression: Find an element by evaluating the specified string. This allows you to traverse the HTML Document Object Model using JavaScript. Note that you must not return a value in this string; simply make it the last expression in the block.
o dom=document.forms['myForm'].myDropdown
o dom=document.images[56]
o dom=function foo() { return document.links[1]; }; foo();
• xpath=xpathExpression: Locate an element using an XPath expression.
o xpath=//img[@alt='The image alt text']
o xpath=//table[@id='table1']//tr[4]/td[2]
o xpath=//a[contains(@href,'#id1')]
o xpath=//a[contains(@href,'#id1')]/@class
o xpath=(//table[@class='stylee'])//th[text()='theHeaderText']/../td
o xpath=//input[@name='name2' and @value='yes']
o xpath=//*[text()="right"]
• link=textPattern: Select the link (anchor) element which contains text matching the specified pattern.
o link=The link text
• css=cssSelectorSyntax: Select the element using css selectors. Please refer to CSS2 selectors, CSS3 selectors for more information. You can also check the TestCssLocators test in the selenium test suite for an example of usage, which is included in the downloaded selenium core package.
o css=a[href="#id3"]
o css=span#firstChild + span
Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after).
Without an explicit locator prefix, Selenium uses the following default strategies:
• dom, for locators starting with "document."
• xpath, for locators starting with "//"
• identifier, otherwise
Element Filters
Element filters can be used with a locator to refine a list of candidate elements. They are currently used only in the 'name' element-locator.
Filters look much like locators, ie.
filterType=argument
Supported element-filters are:
value=valuePattern
Matches elements based on their values. This is particularly useful for refining a list of similarly-named toggle-buttons.
index=index
Selects a single element based on its position in the list (offset from zero).
String-match Patterns
Various Pattern syntaxes are available for matching string values:
• glob:pattern: Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a kind of limited regular-expression syntax typically used in command-line shells. In a glob pattern, "*" represents any sequence of characters, and "?" represents any single character. Glob patterns match against the entire string.
• regexp:regexp: Match a string using a regular-expression. The full power of JavaScript regular-expressions is available.
• exact:string: Match a string exactly, verbatim, without any of that fancy wildcard stuff.
If no pattern prefix is specified, Selenium assumes that it's a "glob" pattern.
Selenium Actions
addLocationStrategy ( strategyName,functionDefinition )
Defines a new function for Selenium to locate elements on the page. For example, if you define the strategy "foo", and someone runs click("foo=blah"), we'll run your function, passing you the string "blah", and click on the element that your function returns, or throw an "Element not found" error if your function returns null. We'll pass three arguments to your function:
• locator: the string the user passed in
• inWindow: the currently selected window
• inDocument: the currently selected document
The function must return null if the element can't be found.
Arguments:
• strategyName - the name of the strategy to define; this should use only letters [a-zA-Z] with no spaces or other punctuation.
• functionDefinition - a string defining the body of a function in JavaScript. For example: return inDocument.getElementById(locator);

addSelection ( locator,optionLocator )
Add a selection to the set of selected options in a multi-select element using an option locator. @see #doSelect for details of option locators
Arguments:
• locator - an element locator identifying a multi-select box
• optionLocator - an option locator (a label by default)

allowNativeXpath ( allow )
Specifies whether Selenium should use the native in-browser implementation of XPath (if any native version is available); if you pass "false" to this function, we will always use our pure-JavaScript xpath library. Using the pure-JS xpath library can improve the consistency of xpath element locators between different browser vendors, but the pure-JS version is much slower than the native implementations.
Arguments:
• allow - boolean, true means we'll prefer to use native XPath; false means we'll only use JS XPath

altKeyDown ( )
Press the alt key and hold it down until doAltUp() is called or a new page is loaded.

altKeyUp ( )
Release the alt key.

answerOnNextPrompt ( answer )
Instructs Selenium to return the specified answer string in response to the next JavaScript prompt [window.prompt()].
Arguments:
• answer - the answer to give in response to the prompt pop-up

assignId ( locator,identifier )
Temporarily sets the "id" attribute of the specified element, so you can locate it in the future using its ID rather than a slow/complicated XPath. This ID will disappear once the page is reloaded.
Arguments:
• locator - an element locator pointing to an element
• identifier - a string to be used as the ID of the specified element

break ( )
Halt the currently running test, and wait for the user to press the Continue button. This command is useful for debugging, but be careful when using it, because it will force automated tests to hang until a user intervenes manually.

check ( locator )
Check a toggle-button (checkbox/radio)
Arguments:
• locator - an element locator

chooseCancelOnNextConfirmation ( )
By default, Selenium's overridden window.confirm() function will return true, as if the user had manually clicked OK; after running this command, the next call to confirm() will return false, as if the user had clicked Cancel. Selenium will then resume using the default behavior for future confirmations, automatically returning true (OK) unless/until you explicitly call this command for each confirmation.

chooseOkOnNextConfirmation ( )
Undo the effect of calling chooseCancelOnNextConfirmation. Note that Selenium's overridden window.confirm() function will normally automatically return true, as if the user had manually clicked OK, so you shouldn't need to use this command unless for some reason you need to change your mind prior to the next confirmation. After any confirmation, Selenium will resume using the default behavior for future confirmations, automatically returning true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each confirmation.

click ( locator )
Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call waitForPageToLoad.
Arguments:
• locator - an element locator

clickAt ( locator,coordString )
Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call waitForPageToLoad.
Arguments:
• locator - an element locator
• coordString - specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

close ( )
Simulates the user clicking the "close" button in the titlebar of a popup window or tab.

controlKeyDown ( )
Press the control key and hold it down until doControlUp() is called or a new page is loaded.

controlKeyUp ( )
Release the control key.

createCookie ( nameValuePair,optionsString )
Create a new cookie whose path and domain are same with those of current page under test, unless you specified a path for this cookie explicitly.
Arguments:
• nameValuePair - name and value of the cookie in a format "name=value"
• optionsString - options for the cookie. Currently supported options include 'path' and 'max_age'. the optionsString's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit of the value of 'max_age' is second.

deleteCookie ( name,path )
Delete a named cookie with specified path.
Arguments:
• name - the name of the cookie to be deleted
• path - the path property of the cookie to be deleted

doubleClick ( locator )
Double clicks on a link, button, checkbox or radio button. If the double click action causes a new page to load (like a link usually does), call waitForPageToLoad.
Arguments:
• locator - an element locator

doubleClickAt ( locator,coordString )
Doubleclicks on a link, button, checkbox or radio button. If the action causes a new page to load (like a link usually does), call waitForPageToLoad.
Arguments:
• locator - an element locator
• coordString - specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

dragAndDrop ( locator,movementsString )
Drags an element a certain distance and then drops it
Arguments:
• locator - an element locator
• movementsString - offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"

dragAndDropToObject ( locatorOfObjectToBeDragged,locatorOfDragDestinationObject )
Drags an element and drops it on another element
Arguments:
• locatorOfObjectToBeDragged - an element to be dragged
• locatorOfDragDestinationObject - an element whose location (i.e., whose center-most pixel) will be the point where locatorOfObjectToBeDragged is dropped

dragdrop ( locator,movementsString )
deprecated - use dragAndDrop instead
Arguments:
• locator - an element locator
• movementsString - offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"

echo ( message )
Prints the specified message into the third table cell in your Selenese tables. Useful for debugging.
Arguments:
• message - the message to print

fireEvent ( locator,eventName )
Explicitly simulate an event, to trigger the corresponding "onevent" handler.
Arguments:
• locator - an element locator
• eventName - the event name, e.g. "focus" or "blur"

getSpeed ( )
Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). By default, there is no such delay, i.e., the delay is 0 milliseconds. See also setSpeed.

goBack ( )
Simulates the user clicking the "back" button on their browser.

highlight ( locator )
Briefly changes the backgroundColor of the specified element yellow. Useful for debugging.
Arguments:
• locator - an element locator

keyDown ( locator,keySequence )
Simulates a user pressing a key (without releasing it yet).
Arguments:
• locator - an element locator
• keySequence - Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119".

keyPress ( locator,keySequence )
Simulates a user pressing and releasing a key.
Arguments:
• locator - an element locator
• keySequence - Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119".

keyUp ( locator,keySequence )
Simulates a user releasing a key.
Arguments:
• locator - an element locator
• keySequence - Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119".

metaKeyDown ( )
Press the meta key and hold it down until doMetaUp() is called or a new page is loaded.

metaKeyUp ( )
Release the meta key.

mouseDown ( locator )
Simulates a user pressing the mouse button (without releasing it yet) on the specified element.
Arguments:
• locator - an element locator

mouseDownAt ( locator,coordString )
Simulates a user pressing the mouse button (without releasing it yet) at the specified location.
Arguments:
• locator - an element locator
• coordString - specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

mouseMove ( locator )
Simulates a user pressing the mouse button (without releasing it yet) on the specified element.
Arguments:
• locator - an element locator

mouseMoveAt ( locator,coordString )
Simulates a user pressing the mouse button (without releasing it yet) on the specified element.
Arguments:
• locator - an element locator
• coordString - specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

mouseOut ( locator )
Simulates a user moving the mouse pointer away from the specified element.
Arguments:
• locator - an element locator

mouseOver ( locator )
Simulates a user hovering a mouse over the specified element.
Arguments:
• locator - an element locator

mouseUp ( locator )
Simulates the event that occurs when the user releases the mouse button (i.e., stops holding the button down) on the specified element.
Arguments:
• locator - an element locator

mouseUpAt ( locator,coordString )
Simulates the event that occurs when the user releases the mouse button (i.e., stops holding the button down) at the specified location.
Arguments:
• locator - an element locator
• coordString - specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

open ( url )
Opens an URL in the test frame. This accepts both relative and absolute URLs. The "open" command waits for the page to load before proceeding, ie. the "AndWait" suffix is implicit. Note: The URL must be on the same domain as the runner HTML due to security restrictions in the browser (Same Origin Policy). If you need to open an URL on another domain, use the Selenium Server to start a new browser session on that domain.
Arguments:
• url - the URL to open; may be relative or absolute

openWindow ( url,windowID )
Opens a popup window (if a window with that ID isn't already open). After opening the window, you'll need to select it using the selectWindow command.
This command can also be a useful workaround for bug SEL-339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow").
Arguments:
• url - the URL to open, which can be blank
• windowID - the JavaScript window ID of the window to select

pause ( waitTime )
Wait for the specified amount of time (in milliseconds)
Arguments:
• waitTime - the amount of time to sleep (in milliseconds)

refresh ( )
Simulates the user clicking the "Refresh" button on their browser.

removeAllSelections ( locator )
Unselects all of the selected options in a multi-select element.
Arguments:
• locator - an element locator identifying a multi-select box

removeSelection ( locator,optionLocator )
Remove a selection from the set of selected options in a multi-select element using an option locator. @see #doSelect for details of option locators
Arguments:
• locator - an element locator identifying a multi-select box
• optionLocator - an option locator (a label by default)

runScript ( script )
Creates a new "script" tag in the body of the current test window, and adds the specified text into the body of the command. Scripts run in this way can often be debugged more easily than scripts executed using Selenium's "getEval" command. Beware that JS exceptions thrown in these script tags aren't managed by Selenium, so you should probably wrap your script in try/catch blocks if there is any chance that the script will throw an exception.
Arguments:
• script - the JavaScript snippet to run

select ( selectLocator,optionLocator )
Select an option from a drop-down using an option locator.
Option locators provide different ways of specifying options of an HTML Select element (e.g. for selecting a specific option, or for asserting that the selected option satisfies a specification). There are several forms of Select Option Locator.
• label=labelPattern: matches options based on their labels, i.e. the visible text. (This is the default.)
o label=regexp:^[Oo]ther
• value=valuePattern: matches options based on their values.
o value=other
• id=id: matches options based on their ids.
o id=option1
• index=index: matches an option based on its index (offset from zero).
o index=2
If no option locator prefix is provided, the default behaviour is to match on label.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• optionLocator - an option locator (a label by default)

selectFrame ( locator )
Selects a frame within the current window. (You may invoke this command multiple times to select nested frames.) To select the parent frame, use "relative=parent" as a locator; to select the top frame, use "relative=top". You can also select a frame by its 0-based index number; select the first frame with "index=0", or the third frame with "index=2".
You may also use a DOM expression to identify the frame you want directly, like this: dom=frames["main"].frames["subframe"]
Arguments:
• locator - an element locator identifying a frame or iframe

selectWindow ( windowID )
Selects a popup window; once a popup window has been selected, all commands go to that window. To select the main window again, use null as the target.
Note that there is a big difference between a window's internal JavaScript "name" property and the "title" of a given window's document (which is normally what you actually see, as an end user, in the title bar of the window). The "name" is normally invisible to the end-user; it's the second parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag) (which selenium intercepts).
Selenium has several strategies for finding the window object referred to by the "windowID" parameter.
1.) if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser).
2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed that this variable contains the return value from a call to the JavaScript window.open() method.
3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names".
4.) If that fails, we'll try looping over all of the known windows to try to find the appropriate "title". Since "title" is not necessarily unique, this may have unexpected behavior.
If you're having trouble figuring out what is the name of a window that you want to manipulate, look at the selenium log messages which identify the names of windows created via window.open (and therefore intercepted by selenium). You will see messages like the following for each window as it is opened:
debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"
In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow").
Arguments:
• windowID - the JavaScript window ID of the window to select

setBrowserLogLevel ( logLevel )
Sets the threshold for browser-side logging messages; log messages beneath this threshold will be discarded. Valid logLevel strings are: "debug", "info", "warn", "error" or "off". To see the browser logs, you need to either show the log window in GUI mode, or enable browser-side logging in Selenium RC.
Arguments:
• logLevel - one of the following: "debug", "info", "warn", "error" or "off"

setCursorPosition ( locator,position )
Moves the text cursor to the specified position in the given input element or textarea. This method will fail if the specified element isn't an input element or textarea.
Arguments:
• locator - an element locator pointing to an input element or textarea
• position - the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field. You can also set the cursor to -1 to move it to the end of the field.

setMouseSpeed ( pixels )
Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10).
Setting this value to 0 means that we'll send a "mousemove" event to every single pixel in between the start location and the end location; that can be very slow, and may cause some browsers to force the JavaScript to timeout.
If the mouse speed is greater than the distance between the two dragged objects, we'll just send one "mousemove" at the start location and then one final one at the end location.
Arguments:
• pixels - the number of pixels between "mousemove" events

setSpeed ( value )
Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). By default, there is no such delay, i.e., the delay is 0 milliseconds.
Arguments:
• value - the number of milliseconds to pause after operation

setTimeout ( timeout )
Specifies the amount of time that Selenium will wait for actions to complete.
Actions that require waiting include "open" and the "waitFor*" actions.
The default timeout is 30 seconds.
Arguments:
• timeout - a timeout in milliseconds, after which the action will return with an error

shiftKeyDown ( )
Press the shift key and hold it down until doShiftUp() is called or a new page is loaded.

shiftKeyUp ( )
Release the shift key.

store ( expression,variableName )
This command is a synonym for storeExpression.
Arguments:
• expression - the value to store
• variableName - the name of a variable in which the result is to be stored.

submit ( formLocator )
Submit the specified form. This is particularly useful for forms without submit buttons, e.g. single-input "Search" forms.
Arguments:
• formLocator - an element locator for the form you want to submit

type ( locator,value )
Sets the value of an input field, as though you typed it in.
Can also be used to set the value of combo boxes, check boxes, etc. In these cases, value should be the value of the option selected, not the visible text.
Arguments:
• locator - an element locator
• value - the value to type

typeKeys ( locator,value )
Simulates keystroke events on the specified element, as though you typed the value key-by-key.
This is a convenience method for calling keyDown, keyUp, keyPress for every character in the specified string; this is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events.
Unlike the simple "type" command, which forces the specified value into the page directly, this command may or may not have any visible effect, even in cases where typing keys would normally have a visible effect. For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in the field.
In some cases, you may need to use the simple "type" command to set the value of the field and then the "typeKeys" command to send the keystroke events corresponding to what you just typed.
Arguments:
• locator - an element locator
• value - the value to type

uncheck ( locator )
Uncheck a toggle-button (checkbox/radio)
Arguments:
• locator - an element locator

waitForCondition ( script,timeout )
Runs the specified JavaScript snippet repeatedly until it evaluates to "true". The snippet may have multiple lines, but only the result of the last line will be considered.
Note that, by default, the snippet will be run in the runner's test window, not in the window of your application. To get the window of your application, you can use the JavaScript snippet selenium.browserbot.getCurrentWindow(), and then run your JavaScript in there
Arguments:
• script - the JavaScript snippet to run
• timeout - a timeout in milliseconds, after which this command will return with an error

waitForFrameToLoad ( frameAddress,timeout )
Waits for a new frame to load.
Selenium constantly keeps track of new pages and frames loading, and sets a "newPageLoaded" flag when it first notices a page load.
See waitForPageToLoad for more information.
Arguments:
• frameAddress - FrameAddress from the server side
• timeout - a timeout in milliseconds, after which this command will return with an error

waitForPageToLoad ( timeout )
Waits for a new page to load.
You can use this command instead of the "AndWait" suffixes, "clickAndWait", "selectAndWait", "typeAndWait" etc. (which are only available in the JS API).
Selenium constantly keeps track of new pages loading, and sets a "newPageLoaded" flag when it first notices a page load. Running any other Selenium command after turns the flag to false. Hence, if you want to wait for a page to load, you must wait immediately after a Selenium command that caused a page-load.
Arguments:
• timeout - a timeout in milliseconds, after which this command will return with an error

waitForPopUp ( windowID,timeout )
Waits for a popup window to appear and load up.
Arguments:
• windowID - the JavaScript window ID of the window that will appear
• timeout - a timeout in milliseconds, after which the action will return with an error

windowFocus ( )
Gives focus to the currently selected window

windowMaximize ( )
Resize currently selected window to take up the entire screen

Selenium Accessors
assertErrorOnNext ( message )
Tell Selenium to expect an error on the next command execution.
Arguments:
• message - The error message we should expect. This command will fail if the wrong error message appears.
Related Assertions, automatically generated:
• assertNotErrorOnNext ( message )
• verifyErrorOnNext ( message )
• verifyNotErrorOnNext ( message )
• waitForErrorOnNext ( message )
• waitForNotErrorOnNext ( message )

assertFailureOnNext ( message )
Tell Selenium to expect a failure on the next command execution.
Arguments:
• message - The failure message we should expect. This command will fail if the wrong failure message appears.
Related Assertions, automatically generated:
• assertNotFailureOnNext ( message )
• verifyFailureOnNext ( message )
• verifyNotFailureOnNext ( message )
• waitForFailureOnNext ( message )
• waitForNotFailureOnNext ( message )

assertSelected ( selectLocator,optionLocator )
Verifies that the selected option of a drop-down satisfies the optionSpecifier. Note that this command is deprecated; you should use assertSelectedLabel, assertSelectedValue, assertSelectedIndex, or assertSelectedId instead.
See the select command for more information about option locators.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• optionLocator - an option locator, typically just an option label (e.g. "John Smith")
Related Assertions, automatically generated:
• assertNotSelected ( selectLocator, optionLocator )
• verifySelected ( selectLocator, optionLocator )
• verifyNotSelected ( selectLocator, optionLocator )
• waitForSelected ( selectLocator, optionLocator )
• waitForNotSelected ( selectLocator, optionLocator )

storeAlert ( variableName )
Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
Getting an alert has the same effect as manually clicking OK. If an alert is generated but you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert dialog.
NOTE: Selenium does NOT support JavaScript alerts that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK.
Returns:
The message of the most recent JavaScript alert
Related Assertions, automatically generated:
• assertAlert ( pattern )
• assertNotAlert ( pattern )
• verifyAlert ( pattern )
• verifyNotAlert ( pattern )
• waitForAlert ( pattern )
• waitForNotAlert ( pattern )

storeAllButtons ( variableName )
Returns the IDs of all buttons on the page.
If a given button has no ID, it will appear as "" in this array.
Returns:
the IDs of all buttons on the page
Related Assertions, automatically generated:
• assertAllButtons ( pattern )
• assertNotAllButtons ( pattern )
• verifyAllButtons ( pattern )
• verifyNotAllButtons ( pattern )
• waitForAllButtons ( pattern )
• waitForNotAllButtons ( pattern )

storeAllFields ( variableName )
Returns the IDs of all input fields on the page.
If a given field has no ID, it will appear as "" in this array.
Returns:
the IDs of all field on the page
Related Assertions, automatically generated:
• assertAllFields ( pattern )
• assertNotAllFields ( pattern )
• verifyAllFields ( pattern )
• verifyNotAllFields ( pattern )
• waitForAllFields ( pattern )
• waitForNotAllFields ( pattern )

storeAllLinks ( variableName )
Returns the IDs of all links on the page.
If a given link has no ID, it will appear as "" in this array.
Returns:
the IDs of all links on the page
Related Assertions, automatically generated:
• assertAllLinks ( pattern )
• assertNotAllLinks ( pattern )
• verifyAllLinks ( pattern )
• verifyNotAllLinks ( pattern )
• waitForAllLinks ( pattern )
• waitForNotAllLinks ( pattern )

storeAllWindowIds ( variableName )
Returns the IDs of all windows that the browser knows about.
Returns:
the IDs of all windows that the browser knows about.
Related Assertions, automatically generated:
• assertAllWindowIds ( pattern )
• assertNotAllWindowIds ( pattern )
• verifyAllWindowIds ( pattern )
• verifyNotAllWindowIds ( pattern )
• waitForAllWindowIds ( pattern )
• waitForNotAllWindowIds ( pattern )

storeAllWindowNames ( variableName )
Returns the names of all windows that the browser knows about.
Returns:
the names of all windows that the browser knows about.
Related Assertions, automatically generated:
• assertAllWindowNames ( pattern )
• assertNotAllWindowNames ( pattern )
• verifyAllWindowNames ( pattern )
• verifyNotAllWindowNames ( pattern )
• waitForAllWindowNames ( pattern )
• waitForNotAllWindowNames ( pattern )

storeAllWindowTitles ( variableName )
Returns the titles of all windows that the browser knows about.
Returns:
the titles of all windows that the browser knows about.
Related Assertions, automatically generated:
• assertAllWindowTitles ( pattern )
• assertNotAllWindowTitles ( pattern )
• verifyAllWindowTitles ( pattern )
• verifyNotAllWindowTitles ( pattern )
• waitForAllWindowTitles ( pattern )
• waitForNotAllWindowTitles ( pattern )

storeAttribute ( attributeLocator, variableName )
Gets the value of an element attribute.
Arguments:
• attributeLocator - an element locator followed by an @ sign and then the name of the attribute, e.g. "foo@bar"
• variableName - the name of a variable in which the result is to be stored.
Returns:
the value of the specified attribute
Related Assertions, automatically generated:
• assertAttribute ( attributeLocator, pattern )
• assertNotAttribute ( attributeLocator, pattern )
• verifyAttribute ( attributeLocator, pattern )
• verifyNotAttribute ( attributeLocator, pattern )
• waitForAttribute ( attributeLocator, pattern )
• waitForNotAttribute ( attributeLocator, pattern )

storeAttributeFromAllWindows ( attributeName, variableName )
Returns every instance of some attribute from all known windows.
Arguments:
• attributeName - name of an attribute on the windows
• variableName - the name of a variable in which the result is to be stored.
Returns:
the set of values of this attribute from all known windows.
Related Assertions, automatically generated:
• assertAttributeFromAllWindows ( attributeName, pattern )
• assertNotAttributeFromAllWindows ( attributeName, pattern )
• verifyAttributeFromAllWindows ( attributeName, pattern )
• verifyNotAttributeFromAllWindows ( attributeName, pattern )
• waitForAttributeFromAllWindows ( attributeName, pattern )
• waitForNotAttributeFromAllWindows ( attributeName, pattern )

storeBodyText ( variableName )
Gets the entire text of the page.
Returns:
the entire text of the page
Related Assertions, automatically generated:
• assertBodyText ( pattern )
• assertNotBodyText ( pattern )
• verifyBodyText ( pattern )
• verifyNotBodyText ( pattern )
• waitForBodyText ( pattern )
• waitForNotBodyText ( pattern )

storeConfirmation ( variableName )
Retrieves the message of a JavaScript confirmation dialog generated during the previous action.
By default, the confirm function will return true, having the same effect as manually clicking OK. This can be changed by prior execution of the chooseCancelOnNextConfirmation command. If an confirmation is generated but you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible dialog.
NOTE: Selenium does NOT support JavaScript confirmations that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until you manually click OK.
Returns:
the message of the most recent JavaScript confirmation dialog
Related Assertions, automatically generated:
• assertConfirmation ( pattern )
• assertNotConfirmation ( pattern )
• verifyConfirmation ( pattern )
• verifyNotConfirmation ( pattern )
• waitForConfirmation ( pattern )
• waitForNotConfirmation ( pattern )

storeCookie ( variableName )
Return all cookies of the current page under test.
Returns:
all cookies of the current page under test
Related Assertions, automatically generated:
• assertCookie ( pattern )
• assertNotCookie ( pattern )
• verifyCookie ( pattern )
• verifyNotCookie ( pattern )
• waitForCookie ( pattern )
• waitForNotCookie ( pattern )

storeCursorPosition ( locator, variableName )
Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers.
Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as SEL-243.
This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element.
Arguments:
• locator - an element locator pointing to an input element or textarea
• variableName - the name of a variable in which the result is to be stored.
Returns:
the numerical position of the cursor in the field
Related Assertions, automatically generated:
• assertCursorPosition ( locator, pattern )
• assertNotCursorPosition ( locator, pattern )
• verifyCursorPosition ( locator, pattern )
• verifyNotCursorPosition ( locator, pattern )
• waitForCursorPosition ( locator, pattern )
• waitForNotCursorPosition ( locator, pattern )

storeElementHeight ( locator, variableName )
Retrieves the height of an element
Arguments:
• locator - an element locator pointing to an element
• variableName - the name of a variable in which the result is to be stored.
Returns:
height of an element in pixels
Related Assertions, automatically generated:
• assertElementHeight ( locator, pattern )
• assertNotElementHeight ( locator, pattern )
• verifyElementHeight ( locator, pattern )
• verifyNotElementHeight ( locator, pattern )
• waitForElementHeight ( locator, pattern )
• waitForNotElementHeight ( locator, pattern )

storeElementIndex ( locator, variableName )
Get the relative index of an element to its parent (starting from 0). The comment node and empty text node will be ignored.
Arguments:
• locator - an element locator pointing to an element
• variableName - the name of a variable in which the result is to be stored.
Returns:
of relative index of the element to its parent (starting from 0)
Related Assertions, automatically generated:
• assertElementIndex ( locator, pattern )
• assertNotElementIndex ( locator, pattern )
• verifyElementIndex ( locator, pattern )
• verifyNotElementIndex ( locator, pattern )
• waitForElementIndex ( locator, pattern )
• waitForNotElementIndex ( locator, pattern )

storeElementPositionLeft ( locator, variableName )
Retrieves the horizontal position of an element
Arguments:
• locator - an element locator pointing to an element OR an element itself
• variableName - the name of a variable in which the result is to be stored.
Returns:
of pixels from the edge of the frame.
Related Assertions, automatically generated:
• assertElementPositionLeft ( locator, pattern )
• assertNotElementPositionLeft ( locator, pattern )
• verifyElementPositionLeft ( locator, pattern )
• verifyNotElementPositionLeft ( locator, pattern )
• waitForElementPositionLeft ( locator, pattern )
• waitForNotElementPositionLeft ( locator, pattern )

storeElementPositionTop ( locator, variableName )
Retrieves the vertical position of an element
Arguments:
• locator - an element locator pointing to an element OR an element itself
• variableName - the name of a variable in which the result is to be stored.
Returns:
of pixels from the edge of the frame.
Related Assertions, automatically generated:
• assertElementPositionTop ( locator, pattern )
• assertNotElementPositionTop ( locator, pattern )
• verifyElementPositionTop ( locator, pattern )
• verifyNotElementPositionTop ( locator, pattern )
• waitForElementPositionTop ( locator, pattern )
• waitForNotElementPositionTop ( locator, pattern )

storeElementWidth ( locator, variableName )
Retrieves the width of an element
Arguments:
• locator - an element locator pointing to an element
• variableName - the name of a variable in which the result is to be stored.
Returns:
width of an element in pixels
Related Assertions, automatically generated:
• assertElementWidth ( locator, pattern )
• assertNotElementWidth ( locator, pattern )
• verifyElementWidth ( locator, pattern )
• verifyNotElementWidth ( locator, pattern )
• waitForElementWidth ( locator, pattern )
• waitForNotElementWidth ( locator, pattern )

storeEval ( script, variableName )
Gets the result of evaluating the specified JavaScript snippet. The snippet may have multiple lines, but only the result of the last line will be returned.
Note that, by default, the snippet will run in the context of the "selenium" object itself, so this will refer to the Selenium object. Use window to refer to the window of your application, e.g. window.document.getElementById('foo')
If you need to use a locator to refer to a single element in your application page, you can use this.browserbot.findElement("id=foo") where "id=foo" is your locator.
Arguments:
• script - the JavaScript snippet to run
• variableName - the name of a variable in which the result is to be stored.
Returns:
the results of evaluating the snippet
Related Assertions, automatically generated:
• assertEval ( script, pattern )
• assertNotEval ( script, pattern )
• verifyEval ( script, pattern )
• verifyNotEval ( script, pattern )
• waitForEval ( script, pattern )
• waitForNotEval ( script, pattern )

storeExpression ( expression, variableName )
Returns the specified expression.
This is useful because of JavaScript preprocessing. It is used to generate commands like assertExpression and waitForExpression.
Arguments:
• expression - the value to return
• variableName - the name of a variable in which the result is to be stored.
Returns:
the value passed in
Related Assertions, automatically generated:
• assertExpression ( expression, pattern )
• assertNotExpression ( expression, pattern )
• verifyExpression ( expression, pattern )
• verifyNotExpression ( expression, pattern )
• waitForExpression ( expression, pattern )
• waitForNotExpression ( expression, pattern )

storeHtmlSource ( variableName )
Returns the entire HTML source between the opening and closing "html" tags.
Returns:
the entire HTML source
Related Assertions, automatically generated:
• assertHtmlSource ( pattern )
• assertNotHtmlSource ( pattern )
• verifyHtmlSource ( pattern )
• verifyNotHtmlSource ( pattern )
• waitForHtmlSource ( pattern )
• waitForNotHtmlSource ( pattern )

storeLocation ( variableName )
Gets the absolute URL of the current page.
Returns:
the absolute URL of the current page
Related Assertions, automatically generated:
• assertLocation ( pattern )
• assertNotLocation ( pattern )
• verifyLocation ( pattern )
• verifyNotLocation ( pattern )
• waitForLocation ( pattern )
• waitForNotLocation ( pattern )

storeMouseSpeed ( variableName )
Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10).
Returns:
the number of pixels between "mousemove" events during dragAndDrop commands (default=10)
Related Assertions, automatically generated:
• assertMouseSpeed ( pattern )
• assertNotMouseSpeed ( pattern )
• verifyMouseSpeed ( pattern )
• verifyNotMouseSpeed ( pattern )
• waitForMouseSpeed ( pattern )
• waitForNotMouseSpeed ( pattern )

storePrompt ( variableName )
Retrieves the message of a JavaScript question prompt dialog generated during the previous action.
Successful handling of the prompt requires prior execution of the answerOnNextPrompt command. If a prompt is generated but you do not get/verify it, the next Selenium action will fail.
NOTE: under Selenium, JavaScript prompts will NOT pop up a visible dialog.
NOTE: Selenium does NOT support JavaScript prompts that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK.
Returns:
the message of the most recent JavaScript question prompt
Related Assertions, automatically generated:
• assertPrompt ( pattern )
• assertNotPrompt ( pattern )
• verifyPrompt ( pattern )
• verifyNotPrompt ( pattern )
• waitForPrompt ( pattern )
• waitForNotPrompt ( pattern )

storeSelectedId ( selectLocator, variableName )
Gets option element ID for selected option in the specified select element.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• variableName - the name of a variable in which the result is to be stored.
Returns:
the selected option ID in the specified select drop-down
Related Assertions, automatically generated:
• assertSelectedId ( selectLocator, pattern )
• assertNotSelectedId ( selectLocator, pattern )
• verifySelectedId ( selectLocator, pattern )
• verifyNotSelectedId ( selectLocator, pattern )
• waitForSelectedId ( selectLocator, pattern )
• waitForNotSelectedId ( selectLocator, pattern )

storeSelectedIds ( selectLocator, variableName )
Gets all option element IDs for selected options in the specified select or multi-select element.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• variableName - the name of a variable in which the result is to be stored.
Returns:
an array of all selected option IDs in the specified select drop-down
Related Assertions, automatically generated:
• assertSelectedIds ( selectLocator, pattern )
• assertNotSelectedIds ( selectLocator, pattern )
• verifySelectedIds ( selectLocator, pattern )
• verifyNotSelectedIds ( selectLocator, pattern )
• waitForSelectedIds ( selectLocator, pattern )
• waitForNotSelectedIds ( selectLocator, pattern )

storeSelectedIndex ( selectLocator, variableName )
Gets option index (option number, starting at 0) for selected option in the specified select element.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• variableName - the name of a variable in which the result is to be stored.
Returns:
the selected option index in the specified select drop-down
Related Assertions, automatically generated:
• assertSelectedIndex ( selectLocator, pattern )
• assertNotSelectedIndex ( selectLocator, pattern )
• verifySelectedIndex ( selectLocator, pattern )
• verifyNotSelectedIndex ( selectLocator, pattern )
• waitForSelectedIndex ( selectLocator, pattern )
• waitForNotSelectedIndex ( selectLocator, pattern )

storeSelectedIndexes ( selectLocator, variableName )
Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• variableName - the name of a variable in which the result is to be stored.
Returns:
an array of all selected option indexes in the specified select drop-down
Related Assertions, automatically generated:
• assertSelectedIndexes ( selectLocator, pattern )
• assertNotSelectedIndexes ( selectLocator, pattern )
• verifySelectedIndexes ( selectLocator, pattern )
• verifyNotSelectedIndexes ( selectLocator, pattern )
• waitForSelectedIndexes ( selectLocator, pattern )
• waitForNotSelectedIndexes ( selectLocator, pattern )

storeSelectedLabel ( selectLocator, variableName )
Gets option label (visible text) for selected option in the specified select element.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• variableName - the name of a variable in which the result is to be stored.
Returns:
the selected option label in the specified select drop-down
Related Assertions, automatically generated:
• assertSelectedLabel ( selectLocator, pattern )
• assertNotSelectedLabel ( selectLocator, pattern )
• verifySelectedLabel ( selectLocator, pattern )
• verifyNotSelectedLabel ( selectLocator, pattern )
• waitForSelectedLabel ( selectLocator, pattern )
• waitForNotSelectedLabel ( selectLocator, pattern )

storeSelectedLabels ( selectLocator, variableName )
Gets all option labels (visible text) for selected options in the specified select or multi-select element.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• variableName - the name of a variable in which the result is to be stored.
Returns:
an array of all selected option labels in the specified select drop-down
Related Assertions, automatically generated:
• assertSelectedLabels ( selectLocator, pattern )
• assertNotSelectedLabels ( selectLocator, pattern )
• verifySelectedLabels ( selectLocator, pattern )
• verifyNotSelectedLabels ( selectLocator, pattern )
• waitForSelectedLabels ( selectLocator, pattern )
• waitForNotSelectedLabels ( selectLocator, pattern )

storeSelectedValue ( selectLocator, variableName )
Gets option value (value attribute) for selected option in the specified select element.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• variableName - the name of a variable in which the result is to be stored.
Returns:
the selected option value in the specified select drop-down
Related Assertions, automatically generated:
• assertSelectedValue ( selectLocator, pattern )
• assertNotSelectedValue ( selectLocator, pattern )
• verifySelectedValue ( selectLocator, pattern )
• verifyNotSelectedValue ( selectLocator, pattern )
• waitForSelectedValue ( selectLocator, pattern )
• waitForNotSelectedValue ( selectLocator, pattern )

storeSelectedValues ( selectLocator, variableName )
Gets all option values (value attributes) for selected options in the specified select or multi-select element.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• variableName - the name of a variable in which the result is to be stored.
Returns:
an array of all selected option values in the specified select drop-down
Related Assertions, automatically generated:
• assertSelectedValues ( selectLocator, pattern )
• assertNotSelectedValues ( selectLocator, pattern )
• verifySelectedValues ( selectLocator, pattern )
• verifyNotSelectedValues ( selectLocator, pattern )
• waitForSelectedValues ( selectLocator, pattern )
• waitForNotSelectedValues ( selectLocator, pattern )

storeSelectOptions ( selectLocator, variableName )
Gets all option labels in the specified select drop-down.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• variableName - the name of a variable in which the result is to be stored.
Returns:
an array of all option labels in the specified select drop-down
Related Assertions, automatically generated:
• assertSelectOptions ( selectLocator, pattern )
• assertNotSelectOptions ( selectLocator, pattern )
• verifySelectOptions ( selectLocator, pattern )
• verifyNotSelectOptions ( selectLocator, pattern )
• waitForSelectOptions ( selectLocator, pattern )
• waitForNotSelectOptions ( selectLocator, pattern )

storeTable ( tableCellAddress, variableName )
Gets the text from a cell of a table. The cellAddress syntax tableLocator.row.column, where row and column start at 0.
Arguments:
• tableCellAddress - a cell address, e.g. "foo.1.4"
• variableName - the name of a variable in which the result is to be stored.
Returns:
the text from the specified cell
Related Assertions, automatically generated:
• assertTable ( tableCellAddress, pattern )
• assertNotTable ( tableCellAddress, pattern )
• verifyTable ( tableCellAddress, pattern )
• verifyNotTable ( tableCellAddress, pattern )
• waitForTable ( tableCellAddress, pattern )
• waitForNotTable ( tableCellAddress, pattern )

storeText ( locator, variableName )
Gets the text of an element. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.
Arguments:
• locator - an element locator
• variableName - the name of a variable in which the result is to be stored.
Returns:
the text of the element
Related Assertions, automatically generated:
• assertText ( locator, pattern )
• assertNotText ( locator, pattern )
• verifyText ( locator, pattern )
• verifyNotText ( locator, pattern )
• waitForText ( locator, pattern )
• waitForNotText ( locator, pattern )

storeTitle ( variableName )
Gets the title of the current page.
Returns:
the title of the current page
Related Assertions, automatically generated:
• assertTitle ( pattern )
• assertNotTitle ( pattern )
• verifyTitle ( pattern )
• verifyNotTitle ( pattern )
• waitForTitle ( pattern )
• waitForNotTitle ( pattern )

storeValue ( locator, variableName )
Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). For checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not.
Arguments:
• locator - an element locator
• variableName - the name of a variable in which the result is to be stored.
Returns:
the element value, or "on/off" for checkbox/radio elements
Related Assertions, automatically generated:
• assertValue ( locator, pattern )
• assertNotValue ( locator, pattern )
• verifyValue ( locator, pattern )
• verifyNotValue ( locator, pattern )
• waitForValue ( locator, pattern )
• waitForNotValue ( locator, pattern )

storeWhetherThisFrameMatchFrameExpression ( currentFrameString, target, variableName )
Determine whether current/locator identify the frame containing this running code.
This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" frame. In this case, when the test calls selectFrame, this routine is called for each frame to figure out which one has been selected. The selected frame will return true, while all others will return false.
Arguments:
• currentFrameString - starting frame
• target - new frame (which might be relative to the current one)
• variableName - the name of a variable in which the result is to be stored.
Returns:
true if the new frame is this code's window
Related Assertions, automatically generated:
• assertWhetherThisFrameMatchFrameExpression ( currentFrameString, target )
• assertNotWhetherThisFrameMatchFrameExpression ( currentFrameString, target )
• verifyWhetherThisFrameMatchFrameExpression ( currentFrameString, target )
• verifyNotWhetherThisFrameMatchFrameExpression ( currentFrameString, target )
• waitForWhetherThisFrameMatchFrameExpression ( currentFrameString, target )
• waitForNotWhetherThisFrameMatchFrameExpression ( currentFrameString, target )

storeWhetherThisWindowMatchWindowExpression ( currentWindowString, target, variableName )
Determine whether currentWindowString plus target identify the window containing this running code.
This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" window. In this case, when the test calls selectWindow, this routine is called for each window to figure out which one has been selected. The selected window will return true, while all others will return false.
Arguments:
• currentWindowString - starting window
• target - new window (which might be relative to the current one, e.g., "_parent")
• variableName - the name of a variable in which the result is to be stored.
Returns:
true if the new window is this code's window
Related Assertions, automatically generated:
• assertWhetherThisWindowMatchWindowExpression ( currentWindowString, target )
• assertNotWhetherThisWindowMatchWindowExpression ( currentWindowString, target )
• verifyWhetherThisWindowMatchWindowExpression ( currentWindowString, target )
• verifyNotWhetherThisWindowMatchWindowExpression ( currentWindowString, target )
• waitForWhetherThisWindowMatchWindowExpression ( currentWindowString, target )
• waitForNotWhetherThisWindowMatchWindowExpression ( currentWindowString, target )

storeXpathCount ( xpath, variableName )
Returns the number of nodes that match the specified xpath, eg. "//table" would give the number of tables.
Arguments:
• xpath - the xpath expression to evaluate. do NOT wrap this expression in a 'count()' function; we will do that for you.
• variableName - the name of a variable in which the result is to be stored.
Returns:
the number of nodes that match the specified xpath
Related Assertions, automatically generated:
• assertXpathCount ( xpath, pattern )
• assertNotXpathCount ( xpath, pattern )
• verifyXpathCount ( xpath, pattern )
• verifyNotXpathCount ( xpath, pattern )
• waitForXpathCount ( xpath, pattern )
• waitForNotXpathCount ( xpath, pattern )

storeAlertPresent ( variableName )
Has an alert occurred?
This function never throws an exception
Returns:
true if there is an alert
Related Assertions, automatically generated:
• assertAlertPresent ( )
• assertAlertNotPresent ( )
• verifyAlertPresent ( )
• verifyAlertNotPresent ( )
• waitForAlertPresent ( )
• waitForAlertNotPresent ( )

storeChecked ( locator, variableName )
Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button.
Arguments:
• locator - an element locator pointing to a checkbox or radio button
• variableName - the name of a variable in which the result is to be stored.
Returns:
true if the checkbox is checked, false otherwise
Related Assertions, automatically generated:
• assertChecked ( locator )
• assertNotChecked ( locator )
• verifyChecked ( locator )
• verifyNotChecked ( locator )
• waitForChecked ( locator )
• waitForNotChecked ( locator )

storeConfirmationPresent ( variableName )
Has confirm() been called?
This function never throws an exception
Returns:
true if there is a pending confirmation
Related Assertions, automatically generated:
• assertConfirmationPresent ( )
• assertConfirmationNotPresent ( )
• verifyConfirmationPresent ( )
• verifyConfirmationNotPresent ( )
• waitForConfirmationPresent ( )
• waitForConfirmationNotPresent ( )

storeEditable ( locator, variableName )
Determines whether the specified input element is editable, ie hasn't been disabled. This method will fail if the specified element isn't an input element.
Arguments:
• locator - an element locator
• variableName - the name of a variable in which the result is to be stored.
Returns:
true if the input element is editable, false otherwise
Related Assertions, automatically generated:
• assertEditable ( locator )
• assertNotEditable ( locator )
• verifyEditable ( locator )
• verifyNotEditable ( locator )
• waitForEditable ( locator )
• waitForNotEditable ( locator )

storeElementPresent ( locator, variableName )
Verifies that the specified element is somewhere on the page.
Arguments:
• locator - an element locator
• variableName - the name of a variable in which the result is to be stored.
Returns:
true if the element is present, false otherwise
Related Assertions, automatically generated:
• assertElementPresent ( locator )
• assertElementNotPresent ( locator )
• verifyElementPresent ( locator )
• verifyElementNotPresent ( locator )
• waitForElementPresent ( locator )
• waitForElementNotPresent ( locator )

storeOrdered ( locator1, locator2, variableName )
Check if these two elements have same parent and are ordered siblings in the DOM. Two same elements will not be considered ordered.
Arguments:
• locator1 - an element locator pointing to the first element
• locator2 - an element locator pointing to the second element
• variableName - the name of a variable in which the result is to be stored.
Returns:
true if element1 is the previous sibling of element2, false otherwise
Related Assertions, automatically generated:
• assertOrdered ( locator1, locator2 )
• assertNotOrdered ( locator1, locator2 )
• verifyOrdered ( locator1, locator2 )
• verifyNotOrdered ( locator1, locator2 )
• waitForOrdered ( locator1, locator2 )
• waitForNotOrdered ( locator1, locator2 )

storePromptPresent ( variableName )
Has a prompt occurred?
This function never throws an exception
Returns:
true if there is a pending prompt
Related Assertions, automatically generated:
• assertPromptPresent ( )
• assertPromptNotPresent ( )
• verifyPromptPresent ( )
• verifyPromptNotPresent ( )
• waitForPromptPresent ( )
• waitForPromptNotPresent ( )

storeSomethingSelected ( selectLocator, variableName )
Determines whether some option in a drop-down menu is selected.
Arguments:
• selectLocator - an element locator identifying a drop-down menu
• variableName - the name of a variable in which the result is to be stored.
Returns:
true if some option has been selected, false otherwise
Related Assertions, automatically generated:
• assertSomethingSelected ( selectLocator )
• assertNotSomethingSelected ( selectLocator )
• verifySomethingSelected ( selectLocator )
• verifyNotSomethingSelected ( selectLocator )
• waitForSomethingSelected ( selectLocator )
• waitForNotSomethingSelected ( selectLocator )

storeTextPresent ( pattern, variableName )
Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.
Arguments:
• pattern - a pattern to match with the text of the page
• variableName - the name of a variable in which the result is to be stored.
Returns:
true if the pattern matches the text, false otherwise
Related Assertions, automatically generated:
• assertTextPresent ( pattern )
• assertTextNotPresent ( pattern )
• verifyTextPresent ( pattern )
• verifyTextNotPresent ( pattern )
• waitForTextPresent ( pattern )
• waitForTextNotPresent ( pattern )

storeVisible ( locator, variableName )
Determines if the specified element is visible. An element can be rendered invisible by setting the CSS "visibility" property to "hidden", or the "display" property to "none", either for the element itself or one if its ancestors. This method will fail if the element is not present.
Arguments:
• locator - an element locator
• variableName - the name of a variable in which the result is to be stored.
Returns:
true if the specified element is visible, false otherwise
Related Assertions, automatically generated:
• assertVisible ( locator )
• assertNotVisible ( locator )
• verifyVisible ( locator )
• verifyNotVisible ( locator )
• waitForVisible ( locator )
• waitForNotVisible ( locator )

Parameter construction and Variables
All Selenium command parameters can be constructed using both simple variable substitution as well as full javascript. Both of these mechanisms can access previously stored variables, but do so using different syntax.
Stored Variables
The commands store, storeValue and storeText can be used to store a variable value for later access. Internally, these variables are stored in a map called "storedVars", with values keyed by the variable name. These commands are documented in the command reference.
Variable substitution
Variable substitution provides a simple way to include a previously stored variable in a command parameter. This is a simple mechanism, by which the variable to substitute is indicated by ${variableName}. Multiple variables can be substituted, and intermixed with static text.
Example:
store Mr title
storeValue nameField surname
store ${title} ${surname} fullname
type textElement Full name is: ${fullname}
Javascript evaluation
Javascript evaluation provides the full power of javascript in constructing a command parameter. To use this mechanism, the entire parameter value must be prefixed by 'javascript{' with a trailing '}'. The text inside the braces is evaluated as a javascript expression, and can access previously stored variables using the storedVars map detailed above. Note that variable substitution cannot be combined with javascript evaluation.
Example:
store javascript{'merchant' + (new Date()).getTime()} merchantId
type textElement javascript{storedVars['merchantId'].toUpperCase()}
Extending Selenium
It can be quite simple to extend Selenium, adding your own actions, assertions and locator-strategies. This is done with javascript by adding methods to the Selenium object prototype, and the PageBot object prototype. On startup, Selenium will automatically look through methods on these prototypes, using name patterns to recognise which ones are actions, assertions and locators.
The following examples try to give an indication of how Selenium can be extended with javascript.
Actions
All doFoo methods on the Selenium prototype are added as actions. For each action foo there is also an action fooAndWait registered. An action method can take up to 2 parameters, which will be passed the second and third column values in the test.
Example: Add a "typeRepeated" action to Selenium, which types the text twice into a text box.
Selenium.prototype.doTypeRepeated = function(locator, text) {
// All locator-strategies are automatically handled by "findElement"
var element = this.page().findElement(locator);

// Create the text to type
var valueToType = text + text;

// Replace the element text with the new text
this.page().replaceText(element, valueToType);
};

Accessors/Assertions
All getFoo and isFoo methods on the Selenium prototype are added as accessors (storeFoo). For each accessor there is an assertFoo, verifyFoo and waitForFoo registered. An assert method can take up to 2 parameters, which will be passed the second and third column values in the test. You can also define your own assertions literally as simple "assert" methods, which will also auto-generate "verify" and "waitFor" commands.
Example: Add a valueRepeated assertion, that makes sure that the element value consists of the supplied text repeated. The 2 commands that would be available in tests would be assertValueRepeated and verifyValueRepeated.
Selenium.prototype.assertValueRepeated = function(locator, text) {
// All locator-strategies are automatically handled by "findElement"
var element = this.page().findElement(locator);

// Create the text to verify
var expectedValue = text + text;

// Get the actual element value
var actualValue = element.value;

// Make sure the actual value matches the expected
Assert.matches(expectedValue, actualValue);
};

Automatic availability of storeFoo, assertFoo, assertNotFoo, waitForFoo and waitForNotFoo for every getFoo
All getFoo and isFoo methods on the Selenium prototype automatically result in the availability of storeFoo, assertFoo, assertNotFoo, verifyFoo, verifyNotFoo, waitForFoo, and waitForNotFoo commands.
Example, if you add a getTextLength() method, the following commands will automatically be available: storeTextLength, assertTextLength, assertNotTextLength, verifyTextLength, verifyNotTextLength, waitForTextLength, and waitForNotTextLength commands.
Selenium.prototype.getTextLength = function(locator, text) {
return this.getText(locator).length;
};

Also note that the assertValueRepeated method described above could have been implemented using isValueRepeated, with the added benefit of also automatically getting assertNotValueRepeated, storeValueRepeated, waitForValueRepeated and waitForNotValueRepeated.
Locator Strategies
All locateElementByFoo methods on the PageBot prototype are added as locator-strategies. A locator strategy takes 2 parameters, the first being the locator string (minus the prefix), and the second being the document in which to search.
Example: Add a "valuerepeated=" locator, that finds the first element a value attribute equal to the the supplied value repeated.
// The "inDocument" is a the document you are searching.
PageBot.prototype.locateElementByValueRepeated = function(text, inDocument) {
// Create the text to search for
var expectedValue = text + text;

// Loop through all elements, looking for ones that have
// a value === our expected value
var allElements = inDocument.getElementsByTagName("*");
for (var i = 0; i < allElements.length; i++) { var testElement = allElements[i]; if (testElement.value && testElement.value === expectedValue) { return testElement; } } return null; }; user-extensions.js By default, Selenium looks for a file called "user-extensions.js", and loads the javascript code found in that file. This file provides a convenient location for adding features to Selenium, without needing to modify the core Selenium sources. In the standard distibution, this file does not exist. Users can create this file and place their extension code in this common location, removing the need to modify the Selenium sources, and hopefully assisting with the upgrade process.

What is Selenium IDE

Selenium is an open source tool for web application testing.

This tool is primarily developed in Java Script and browser technologies and hence supports all the major browsers on all the platforms.

In terms of coverage for platform and browser, Selenium is probably one of the best tool available in the market for web applications.

There are three variants of Selenium, which can be used in isolation or in combination to create complete automation suite for your web applications.
• Selenium IDE
• Selenium Core
• Selenium Remote Control

Selenium IDE:
Selenium IDE is the easiest way to use Selenium and most of the time it also serves as a starting point for your automation.

Selenium IDE comes as an extension to the Firefox web browser.

This can be installed from either openqa or mozilla distribution site.

Selenium extension will be downloaded as XPI file. If you open this file using File -> open in Mozilla, it should get installed.

Biggest drawback of Selenium IDE is its limitation in terms of browser support.

Though Selenium scripts can be used for most of the browser and operating system, Scripts written using Selenium IDE can be used for only Firefox browser if it is not used with Selenium RC or Selenium Core.

Selenium IDE is the only flavor of Selenium which allows you to record user action on browser window. It can also record user actions in most of the popular languages like Java, C#, Perl, Ruby etc. This eliminates the need of learning new vendor scripting language.

For executing scripts created in these languages, you will need to use Selenium Remote Control. If you do not want to use Remote Control than you will need to create your test scripts in HTML format.

Selenium can be accessed from tool --> Selenium IDE in your browser toolbar.

As compared to most of the test automation tools it is very simple and lightweight.

The small red button on the right hand side gives you an indication on whether Selenium is in recording mode or not.

Selenium IDE will not record any operation that you do on your computer apart from the events on Firefox browser window.

Other options present on the Selenium IDE toolbar are related to test execution. Run will execute the tests with the maximum possible speed, Walk will execute them with relatively slow speed and in step mode you will need to tell Selenium to take small steps.

Final button present on the Selenium IDE toolbar is the Selenium TestRunner.

Test Runner gives you nice browser interface to execute your tests and also gives summary of how many tests were executed, how many passed and failed. It also gives similar information on commands which were passed or failed

TestRunner is also available to tests developed in HTML Only.

If you open the option window by going to Option , you will see there are some self explanatory options available.

For example, encoding of test files, timeout etc. You can also specify Selenium Core and Selenium IDE extensions on this page.

Selenium extensions can be used to enhance the functionality provided by Selenium. Selenium extensions are not covered in this article, there will be a separate article for specifying and developing extensions for Selenium.

Another tab in the Selenium Options window is Format.

Selenium IDE can generate code in variety of languages, this page gives you an option of specifying what kind of formatting you would like in the generated code.
For example, what should be the header, how it should be indented etc.

Take an action for ex: In the options, select format and specify HTML as your language choice for your automation. Notice that, when you select HTML as your choice of language, additional tab appears on the Selenium IDE called Table.

There are three columns under this Table - Command, Target and Value.

This Table is the crux of how Selenium works. For any element present on the browser, Selenium maps its action in command, target and value.



For example, if you want to type user name in the user name text box Selenium would translate it as
command=type , Target=username text box and value=your username
For commands related to asserts, value can be used to compare the value. For example
command=assertText ,Target=Label and Value=somethingtocompare.

In this case Selenium will compare value of the target with the specified value in subsequent execution.

Selenium gives you enough functionality in terms of identifying Target. You can locate or identify target using DOM, ID, Name, XPath etc.

This helps you in making a robust automation framework. You might find it useful to try Firefox extensions like DOM Inspector or XPath Viewer to get information about the XPath or DOM information of the GUI element under test.

summarize all the steps involved –
• Make sure you have installed Selenium IDE in Firefox.
• Open Firefox and application you want to test
• Launch Selenium IDE using tools-Selenium IDE
• By default, you should be in the recording mode, but confirm it by observing the Red button.
• Select HTML Format.
• Record some actions and make sure that these are coming on Selenium IDE.
• During recording if you right click on any element it will show all the selenium commands available.
• You can also edit existing command, by selecting it and editing on the boxes available.
• You 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.


Thursday, July 22, 2010

HP0-M18 Sample Load Runner Certification Questions

HP LoadRunner
Software - HP0-M18
Q. NO.- 1: What is the LoadRunner term that describes the time a user pauses between
steps?
A. Pacing
B. User Delay
C. Think time
D. Navigation time
Q. NO.- 2: What is the first stage of load testing process?
A. Plan the load test
B. Create the scenario
C. Execute the scenario
D. Create VuGen scripts
Q. NO.- 3: When analyzing a technical aspect of a system under test, which group is a
helpful source of information?
A. End users
B. Functional experts
C. Application experts
D. Corporate executives
Q. NO.- 4: Which file type has an extension .lrr?
A. Script
B. Results
C. Analysis
D. Scenario
Q. NO.- 5: You are a LoadRunner expert consultant and have been assigned to a client
that needs to performance test an application that has not yet been released. How can you
obtain information about the application anticipated load?
A. Estimate how the application will be used
B. Obtain the necessary information from web logs
C. Look in the application’s database to determine the anticipated load
D. Consult with the business experts to determine the anticipated load
Q. NO.- 6: Which LoadRunner component runs the vuser that generates the load?
A. VuGen
B. Analysis
C. Controller
D. Load Generator/host
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 2 of 18
Q. NO.- 7: You are running a 3-tier web application. With which component must the load
generator(s) communicate? (Select Two)
A. VuGen
B. Analysis
C. Controller
D. Web server
E. Database server
F. Application server
Q. NO.- 8: Which statement is an example of a conceptual goal?
A. The application’s update function should still work under heavy load
B. The update transaction must attain 200 concurrent users during peak time
C. The search transaction should respond within 5 seconds during normal usage
D. The login transaction should respond within 4 seconds or less during heavy usage
Q. NO.- 9: Which term defines the end-to-end measurement of time when one or more
steps are completed?
A. Transaction.
B. Action section.
C. Business Process.
D. Business Verification.
Q. NO.- 10: During the analysis of a scenario, you realize that the hits per second become
flat as Vusers continue to increase. What is likely to cause?
A. A bandwidth problem
B. A database server problem
C. A web server connection problem
D. An application server connection problem
Q. NO.- 11: Which scenario type helps you plan for future growth and provides a safety
factor with the application?
A. Debug
B. Full Load
C. Top Time
D. Scalability
Q. NO.- 12: What is an example of a stress test?
A. Purchasing at an e-commerce site
B. Updating orders on a client/server system
C. Viewing upcoming flight itineraries on a flight reservation application
D. Displaying the home page immediately after a marketing promotion has been run
Q. NO.- 13: What is the first indication of a performance problem?
A. The network delay time is above 15ms.
B. The DNS is not resolving the machine name.
C. The Web server's available memory drops below 1 GB.
D. The end user experiences higher than expected response time
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 3 of 18
Q. NO.- 14: You are meeting a new LoadRunner customer. The application under test is a
call center application used by the customer representatives. The representatives are
located in Phoenix, AZ and Columbus, OH. A large customer base resides in Flagstaff, AZ
and Cincinnati, OH. The servers are located in Washington, DC. Where would you place
the load generator machines? (Select two.)
A. Phoenix, AZ
B. Flagstaff, AZ
C. Columbus, OH
D. Cincinnati, OH
E. Washington, DC
Q. NO.- 15: Which file defines the Vusers to execute, the number of Vusers to run, the
goals of the test, the computer that hosts the Vusers, and the conditions under which to
run the load test?
A. Script
B. Group
C. Session
D. Scenario
Q. NO.- 16: What is an external data source?
A. User ID
B. Password
C. E-mail address
D. Purchase order number
Q. NO.- 17: What are the main types of service level agreements available in the Controller
and Analysis? (Select two.)
A. Per Time Interval
B. Errors per Second
C. Over the Whole Run
D. Average Hits per Run
E. Average Throughput per Run
F. Average Transaction Response Time
Q. NO.- 18: Which performance test objective is met when determining the cause of
performance degradation?
A. Reliability
B. Regression
C. Acceptance
D. Capacity planning
E. Product evaluation
F. Bottleneck identification
Q. NO.- 19: What are advantages of using automated load tests over manual load tests?
(Select three.)
A. Repeatability
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 4 of 18
B. Easier to scale
C. Improved validity
D. Increased hardware resources
E. Simplicity of gathering analysis data
Q. NO.- 20: Which tool is used to manage and maintain a scenario?
A. VuGen
B. Analysis
C. Controller
D. Load generator
Q. NO.- 21: Which Analysis graph details transaction response times throughout the
test?
A. Transactions per Second
B. Average Transaction Response Time
C. Transaction Response Time Under Load
D. Transaction Response Time (distribution)
Q. NO.- 22: Which types of reports can be automatically generated in the Analysis tool?
(Select two.)
A. HTML
B. MS Excel
C. MS Word
D. Adobe PDF
E. Crystal Report
F. Rich Text Format
Q. NO.- 23: Which graph can analyze each web page component's relative server and
network time?
A. Throughput
B. Windows Resources
C. Time to First Buffer Breakdown
D. Transaction Performance Summary
Q. NO.- 24: What does the image shown in the exhibit represent?
Exhibit:
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 5 of 18
A. Auto Correlation
B. Service Level Agreement
C. Transaction Performance Summary
D. Transaction Response Time (distribution)
Q. NO.- 25: Which option in the Analysis tool allows you to focus on a specific
measurement within your graph?
A. Drill Down
B. Apply Filter
C. Merge Graphs
D. Auto Correlate
Q. NO.- 26: Which Analysis graph identifies web pages that take the most time; isolates where
time is spent; and helps in identifying DNS resolution, SSL, and connection issues?
A. Windows Resource
B. Network Delay Time
C. Time to First Buffer Breakdown
D. Page Download Time Breakdown
Q. NO.- 27: You are running a test and notice that during the ramp up, the response times are
beginning to drastically increase. How can you instruct LoadRunner to stop ramping up
Vusers and hold the current number?
A. Press the STOP button on the Controller's main window
B. Press the PAUSE button on the Interactive Schedule graph
C. Select the option to wait for the current iteration to end before stopping
D. Select the Vusers in the Ready state from the Vusers window and click the STOP button
Q. NO.- 28: During the run of a scenario, which LoadRunner component stores the
performance monitoring data?
A. Analysis
B. Controller
C. File server
D. Load generator/host
Q. NO.- 29: Which scenario allows LoadRunner to automatically manage the Vusers?
A. Manual
B. Session
C. Real-Life
D. Automated
E. User-Defined
F. Goal-oriented
Q. NO.- 30: Which scenario execution run is used to verity the load limit before more
resources are required?
A. Debug
B. Full Load
C. Top Time
D. Scalability
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 6 of 18
Q. NO.- 31: Where in the Run-time settings can you define to only send messages when an
error occurs?
A. General: Log
B. General: Run Logic
C. General: Miscellaneous
D. General: Additional Attributes
Q. NO.- 32: You are running a test and notice that during the ramp up, the response times
are beginning to drastically increase. How can you instruct LoadRunner to stop ramping
up Vusers and hold the current number?
A. Press the STOP button on the Controller's main window
B. Press the PAUSE button on the Interactive Schedule graph
C. Select the option to wait for the current iteration to end before stopping
D. Select the Vusers in the Ready state from the Vusers window and click the STOP button
Q. NO.- 33 Which scenario execution run allows you to verify the system performs as
expected under load?
A. Debug
B. Full Load
C. Top Time
D. Scalability
Q. NO.- 34: When you specify to iterate a script 10 times, which sections of the script are
iterated?
A. Group
B. Action
C. Vuser_init
D. Vuser_end
Q. NO.- 35: Where are the results stored during the run of a scenario?
A. Analysis
B. Controller
C. Utility server
D. Load generator
Q. NO.- 36: When you define a rendezvous point in a scenario, where should the
Ir_start transaction function be placed?
A. At the end of the action section
B. At the beginning of the action section
C. Immediately after the rendezvous function
D. Immediately before the rendezvous function
Q. NO.- 37: While analyzing the Vuser log files from a scenario run, you see the
following log file from one of the Vusers. Start auto log message stack - Iteration 1.
Starting action BookFlight. BookFlight-c(5): Notify: Transaction WT_00_Home_Page
started. BookFlight.c(7): Error -27796: Failed to connect to server 27.0.0.1:1080
[10061] End auto log message stack. What was the
A. Standard Logging
B. Extended Logging
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 7 of 18
C. Always send a message
D. End, message only when an error occurs
Q. NO.- 38: A script was recorded with an average think time for an advanced user. An
advanced user pauses 5 seconds between clicks. A first-time user pauses an average
of 10 seconds between clicks. How can you modify the think time run-time settings to
emulate a first-time user?
A. Set the think time to s recorded
B. Set the think time to multiply the recorded think time by 4
C. Set the think time to a random percentage between 150% - 250%
D. Set the think time to replay as recorded, but limit the think time to 10 seconds
Q. NO.- 39: How can you validate that the LoadRunner Agent is running on the load
generator?
A. Port 443 will be open.
B. The MIFW.exe process will be running.
C. The radar dish wall appear in the system tray.
D. The load generator will be pinged using the name/DNS/IP.
Q. NO.- 40: Which scenario execution run allows you to look for potential transactions that
require significantly longer times to complete?
A. Debug
B. Full Load
C. Scalability
D. Top Time Transaction
Q. NO.- 41: You run a load test & the performance does not agree with your goals. What is
the next step that should be taken?
A. Consult with subject matter experts
B. Add an additional web server to the environment
C. Add additional memory to the hardware under test
D. Change your run time settings and return the scenario
Q. NO.- 42: Which scenario run is recommended to set the run time settings to Standard
Logging?
A. Debug
B. Full Load
C. Top Time
D. Scalability
Q. NO.- 43: You are analyzing the results for a Debug run and realize that response times
are better than SLAs. What should you do?
A. Re-run the scenario again to validate the transaction response times
B. Inform the project manager that additional performance tests are not necessary
C. Ignore the transaction response times because they are meaningless in a Debug run
D. Prepare for overload/scalability testing because the application is ready for additional users
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 8 of 18
Q. NO.- 44: You want to control the delay between iterations. Where do you set this in the
IZun-time settings?
A. General: Pacing
B. General; Think Time
C. Network: Speed Simulation
D. Browser: Browser Emulation
Q. NO.- 45: Which HTTP error code indicates that an individual business process is failing
under load or the web application itself has crashed?
A. 200
B. 403
C. 401
D. 500
Q. NO.- 46: Which type of file can be used in a new LoadRunner group?
A. .Irr
B. Ira
C. Irs
D. usr
Q. NO.- 47: What is an intersection point in a business process?
A. Scenario
B. Rendezvous
C. Transaction
D. Service level agreement
Q. NO.- 48: Which Run-time settings node is available to all protocols?
A. General
B. Browser
C. Network
D. Internet Protocol
Q. NO.- 49: Where in the Runtime settings would you set your script to run 10 iterations?
A. General: Run Logic
B. General: Miscellaneous
C. Browser: Browser Emulation
D. Internet Protocol: Preferences
Q. NO.- 50: While running a script in the Controller you notice a scripting error. While the
scenario is still open, you return to VuGen, make the coding modification & save the
script. What do you need to do before running the scenario again?
A. Save the scenario
B. Refresh the script in the Controller
C. Refresh the Run-time settings in the Controller
D. Do nothing. The script will automatically refresh.
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 9 of 18
Q. NO.- 51: What instructs LoadRunner to prepare the Vusers so they are in the ready
state?
A. Real-life
B. Initialize
C. Duration
D. Start Vusers
Q. NO.- 52: Which performance test objective is met when determining if the new version
of the software adversely affects response time?
A. Reliability
B. Regression
C. Acceptance
D. Capacity planning
E. Product evaluation
F. Bottleneck identification
Q. NO.- 53: Which term refers to a set of actions or user steps performed within an
application to accomplish a business goal?
A. Transaction
B. Vuser script
C. Business process
D. Business verification
Q. NO.- 54: What is the appropriate scenario outline if your quantitative goal is to attain
2,500 concurrent users for the Update transaction during peak time?
A. Load test should achieve 2,500 users only.
B. Script should define the Update transaction only.
C. Script should define the Update transaction, and the load test should achieve 2,500 users.
D. Script should define the Update transaction, and the load test should achieve 2,500 concurrent
users.
Q. NO.- 55: Which source provides data that resides in an application database?
A. Master data
B. External data
C. User-generated data
D. Server-generated data
Q. NO.- 56: Which tool is used to emulate the steps of real users?
A. VuGen
B. Analysis
C. MI Listener
D. Load generator
Q. NO.- 57: What must have direct communication with VuGen?
A. Controller
B. Load generator
C. Database server
D. Application under test (AUT)
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 10 of 18
Q. NO.- 58: If a load test has to run for 4 hours with 2,000 users, and the average iteration
completes in 10 minutes, how many transactions will run per minute?
A. 150
B. 200
C. 400
D. 475
Q. NO.- 59: What allows you to gather performance metrics for a variety of major backend
system components including firewalls, application servers, and database servers?
A. Monitors
B. Scenarios
C. Transactions
D. Service level agreement
Q. NO.- 60: What is the LoadRunner term for varying values defined in a placeholder that
replaces the hard-coded values?
A. Variable
B. Constant
C. Parameter
D. Correlation
Q. NO.- 61: Which performance test finds the behavior and performance of each tier?
A. Load test
B. Volume test
C. Scalability test
D. Component test
Q. NO.- 62: Which performance test is used to find the system breaking point?
A. Load test
B. Volume test
C. Scalability test
D. Component test
Q. NO.- 63: Which LoadRunner tool captures the communication between the browser and
web server?
A. VuGen
B. Analysis
C. Controller
D. Load generator
Q. NO.- 64: What provides data that is unknown before the application is run?
A. Master data
B. External data
C. User-generated data
D. Server-generated data
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 11 of 18
Q. NO.- 65: Which performance test objective is met when determining if the system is
stable enough to go into production?
A. Reliability
B. Regression
C. Acceptance
D. Capacity planning
E. Product evaluation
F. Bottleneck identification
Q. NO.- 66: View the Business Process Profile table for the e-commerce site shown in the
exhibit. Which business processes are the most critical to record? (Select Two)
Exhibit
A. Sign in
B. Checkout
C. Contact Us
D. View sale items
E. View outlet items
Q. NO.- 67: The exhibit shows a table with the desired number of business processes.
Which percentage would be allocated to each business process in order to execute that
business process the desired number of times?
Exhibit
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 12 of 18
A. View Children Clothing Item - 20% View Men Clothing Item - 15% View Women Clothing Item -
20% View Household Item - 30% View Shoes
B. View Children Clothing Item - 2% View Men Clothing Item -1% View Women Clothing Item -
2% View Household Item - 4% View Shoes – 1%
C. View Children Clothing Item - 20% View Men Clothing Item - 10% View Women Clothing Item -
20% View Household item – 40% View Shoes – 1%
D. View Children Clothing Item - 0.2% View Men Clothing Item - 0.1% View Women Clothing Item
- 0.2% View Household Item - 0.4% View Shoes – 0.1%
Q. NO.- 68: Which step comes after scenario execution in the load testing process?
A. Analyze Results
B. Rerun the Scenario
C. Record the Process
D. Fine Tune the System
Q. NO.- 69: Which level of concurrency identifies how many users are currently in the
process of buying a ticket?
A. System
B. Application
C. Transaction
D. Business process
Q. NO.- 70: Which LoadRunner component is supported on UNIX?
A. VuGen
B. Analysis
C. Controller
D. Load generator
Q. NO.- 71: Which option in the Analysis tool allows you to compare a measurement in a
graph with other measurements during a specific time range of a scenario and view similar
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 13 of 18
trends?
A. Drill Down
B. Apply Filter
C. Merge Graphs
D. Auto Correlate
Q. NO.- 72: Which Analysis graph details transaction response times as a function of
load?
A. Transactions per Second
B. Average Transaction Response Time
C. Transaction Response Time Under Load
D. Transaction Response Time (distribution)
Q. NO.- 73 During analysis of a scenario, you realize that the throughput becomes flat as
Vusers continue to increase. What is the likely cause?
A. A bandwidth problem
B. A database server problem
C. A web server connection problem
D. An application server connection problem
Q. NO.- 74: Which option in the Analysis tool allows you to see the results of two graphs
from the same load test scenario in a single graph?
A. Drill Down
B. Apply Filter
C. Merge Graphs
D. Auto Correlate
Q. NO.- 75: Which Analysis graph shows the number of transactions against transaction
response times?
A. Transactions per Second
B. Average Transaction Response Time
C. Transaction Response Time Under Load
D. Transaction Response Time (distribution)
Q. NO.- 76: In the Analysis tool, what allows you to modify the scale of the x-axis?
A. Think time
B. Granularity
C. Event type
D. Transaction hierarchical path
Q. NO.- 77: Which Analysis graph details the delay for the complete path between the
source and destination machines?
A. MS IIS
B. Windows Resource
C. Network Delay Time
D. Time to First Buffer Breakdown
Q. NO.- 78: What does the elapsed time in the Scenario Status window refer to?
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 14 of 18
A. The time that has elapsed from when all Vusers have finished Initializing
B. The time that has elapsed from when all Vusers were in the running state
C. The time that has elapsed from when you press the start Scenario button
D. The time that has elapsed from when the first Vusers entered the running state
Q. NO.- 79: You configure a scenario to start with a delay of <05:00:00> (HH:MM:SS) just
before leaving from work. You return the next morning to find that the scenario did not
run. Why would this happen?
A. You failed to save the scenario.
B. You failed to save the schedule.
C. You failed to connect to the load generators.
D. You failed to press the START SCENARIO button.
Q. NO.- 80: After the scenario execution, which LoadRunner component is responsible for
collecting and organizing the performance data?
A. VuGen
B. Analysis
C. Controller
D. Load generator
Q. NO.- 81: Where can you view the available Vuser types for which you are licensed?
A. VuGen
B. Analysis
C. Controller
D. Launch screen
Q. NO.- 82: Which scenario run should have identical run-time settings as the Full Load
run?
A. Debug
B. Isolation
C. Top Time
D. Scalability
Q. NO.- 83: Which level of concurrency identifies how many users are currently buying
tickets?
A. System
B. Application
C. Transaction
D. Business Process
Q. NO.- 84: Which performance test checks the stability of a system over an extended
period of time?
A. Load test
B. Volume Test
C. Scalability test
D. Component test
Q. NO.- 85: What displays business processes and volume across a time line?
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 15 of 18
A. Business process profile
B. Task distribution diagram
C. Business process mapping
D. System configuration analysis
Q. NO.- 86: What is the LoadRunner term that describes the time a user pauses between
steps?
A. Pacing
B. User delay
C. Think time
D. Navigation time
Q. NO.- 87: What is the first stage of the load testing process?
A. Plan the load test
B. Create the Scenario
C. Execute the Scenario
D. Create VuGen Scripts
Q. NO.- 88: When analyzing the technical aspects of a system under test, which group is a
helpful source of information?
A. End users
B. Functional experts
C. Application experts
D. Corporate executives
Q. NO.- 89: Which file type has an extension of .Irr?
A. Script
B. Results
C. Analysis
D. Scenario
Q. NO.- 90: You are a LoadRunner expert consultant and have been assigned to a client
that needs to performance test an application that has not yet been released. How can you
obtain information about the application anticipated load?
A. Estimate how the application will be used
B. Obtain the necessary information from web logs
C. Look in the application's database to determine the anticipated load
D. Consult with business experts to determine the anticipated load
Q. NO.- 91: Which scenario type allows you to add, start, and stop Vusers during a
scenario nun?
A. Manual
B. Session
C. Real Life
D. Automated
E. User-Defined
F. Goal-Oriented
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 16 of 18
Q. NO.- 92: On which platform can the Controller be installed?
A. UNIX
B. Linux
C. Windows
D. Sun Solaris
Q. NO.- 93 You arc running a load test to simulate a call center. The representatives log in
to the application in the morning, perform their business processes throughout the day,
and log out before leaving at the end of the day. You notice that the login transaction is
failing for some users and none of the users have started their business processes. Which
configuration is most likely defined for your scenario?
A.The login business process is in the yuser_init section, and the Vusers are defined to initialize
all Vusor before running.
B. The login business process is in the yuser_init section, and the Vusers are defined to initialize
1 Vuser every 10 seconds.
C. The login business process is In the login action section, and the Vusers are defined to
initialize all Vusers before running.
D. The login business process is in the login action section, and the Vusers are defined to
initialize 1 Vuser every 10 seconds.
Q. NO.- 94: During a top time transaction run, what is the recommended load percentage?
A. 20%
B. 35%
C. 50%
D. 100%
Q. NO.- 95: You are testing an employee time entry system. The project manager has
provided you with only 8 weeks to simulate users entering time. Which scenario run mode
would you use to ensure that no more than 8 iterations occur?
A. Group
B. Scenario
C. Duration
D. Global Schedule
E. Real-Life Schedule
F. Run until Complete
Q. NO.- 96: You want to control the amount of delay that a Vuser pauses between
executing steps. Where do you set this in the Run-time settings?
A. General: Pacing
B. General: Think Time
C. Network: Speed Simulation
D. Browser: Browser Emulation
Q. NO.- 97: When creating a new scenario, which types of scenarios can be
defined?(Select two.)
A. Manual
B. Session
C. Real-Life
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 17 of 18
D. Automated
E. User-Defined
F. Goal Oriented
Q. NO.- 98: You want to modify the Server Resource Monitor Data Sampling Rate.
However, this option is currently disabled. What should you do to remedy this?
A. Start the wlrun.exe process on the Controller machine
B. Close the scenario; start the ratat.exe process on the load generator; reopen the scenario
C. Disconnect from the load generator; modify the Data Sampling Rate; reconnect to the load
generator
D. Do nothing as Monitoring of Server Resources is not an option because the customer did not
purchase any Server Resource Monitors
Q. NO.- 99: You want to allow only 50 Vusers to initialize at one time. Where do you define
this value?
A. Script Preferences
B. Script Run-time settings
C. Scenario Run-time settings
D. Load Generator dialog box
Q. NO.- 100: Which performance test determines whether the system handles anticipated
real-world load?
A. Load test
B. Volume test
C. Scalability test
D. Component test
Q. NO.- 101: When running a debug run, what should you be looking for?
A. System Worms as expected under load
B. No errors pertaining to running the load test
C. All server CPU and memory utilization below 50%
D. Transaction response times that are higher than expected
Q. NO.- 102: Where do you define the value to be used for a random sequence seed?
A. Script Preferences
B. Scenario Scheduler
C. Script Run-time settings
D. Scenario Run-time settings
Q. NO.- 103: What is the recommended transaction monitoring frequency for large
scenarios?
A. 3
B. 10
C. 15
D. 30
Q. NO.- 104: What is a collection of Vusers within a scenario called?
A. A set
Examination: HP LoadRunner Software Examination Code: HP0-M18
Page 18 of 18
B. A group
C. A profile
D. A scenario
Q. NO.- 105: When scheduling a scenario, which run modes are available in the Controller?
(Select two.)
A. Group
B. Scenario
C. Duration
D. Global Schedule
E. Real-Life Schedule
F. Run Until Complete
Q. NO.- 106: If you forget to connect to the load generators prior to starting a scenario,
what will happen when the START command is issued?
A. The Controller will attempt to connect to the load generators then begin the scenario.
B. An error message will result, stating that connection must first be made to the load generators.
C. The Vusers will automatically move to the FAILED status, and an error message will be
issued.
D. The Vusers will remain in the DOWN status until connection to the load generator(s) is
manually done.
Q. NO.- 107: What is the recommended logging option in the Run-time setting for a full
load test?
A. Disable
B. Standard
C. Extended
D. Only when an error occurs
Q. NO.- 108: Which scenario run is recommended to set the Run-time setting to Extended
Log, Data Returned by Server?
A. Debug
B. Full Load
C. Top Time
D. Scalability
Q. NO.- 109: When you configure the transaction monitoring frequency, what is the
recommended value for a small scenario?
A. 1
B. 5
C. 10
D. 15
Q. NO.- 110: Which run validates that there is enough test hardware available in the test
environment?
A. Debug run
B. Scalability run
C. Benchmark run
D. Top-Time Transaction run

VUGen Questions - Load Runner Certification

HP Virtual User Generator Software
HP0 - M19
Question - 1
What is used, during the debugging process that will pause execution at a specific point in the
script?
A. Step button
B. Compile button
C. Execution Arrow button
D. Toggle Breakpoint button
Question - 2
Which section in a VuGen script is executed only one time, during Vuser initialization?
A. Login
B. Action
C. vuser_init
D. vuser_end
Question - 3
You want to apply Script A Run-time settings, parameters, extra files, and actions to Script B.
How can this be accomplished?
A. Save Script A script as a template, then apply the template to Script B
B. Export Script A settings to a .cor file, then import the settings to Script B
C. Select the option to create a new Vuser script from, then, select Script A
D. Copy the .ext file located in Script A main directory to Script B main directory
Question - 4
For debugging purposes, you would like to show a browser during replay. Where do you enable
this option?
A. General options
B. Playback options
C. Run-time settings
D. Recording options
Question - 5
You have created several new Auto Correlation rules. A new tester on your team is preparing to
record a group of scripts on the same application on his workstation. What can you do to provide
the tester with the correlation rules?
A. You do not need to do anything. Auto Correlation rules are global and are available to all
testers using the same Controller machine.
B. Under the File menu, you select Zip Operations, then export to a zip file. You have the new
tester import the file into his script.
C. The Auto Correlation rules are saved in the script main folder. You create a share so the
other tester has access to the script main folder.
D. You export the Auto Correlation rules to a .cor file, and then have the new team member
import the .cor file into his Auto Correlation rules.
Question - 6
Examination: HP Virtual User Generator Software Exam Code: HP0-M19
Page 2 of 10
What is the recommended Logging Run-time setting when playing back a script prior to manual
correlation?
A. Standard
B. Disable Logging
C. Extended -> Parameter Substitution
D. Extended -> Data Returned by Server
Question - 7
You want to have your script define a different e-mail address to each user during a registration
process for an e-commerce site, using the following format: testing99999@hp.com. Your script
will execute a maximum of 50 iterations. How can this be accomplished?
A. Define a file parameter, start at 1, block size per Vuser: 50, number format:
testing%05d@hp.com
B. Define a unique number parameter, start at 1, block size per Vuser: 50, number format:
C. Testing%05d@hp.com
D. Define a random number parameter, minimum number: 1, maximum number: 99999, number
format: testing%05d@hp.com
E. Define a sequential number parameter, minimum number: 1, maximum number 999, number
format: testing%05d@hp.com
Question - 8
You want to have each step in your script measured as a transaction in the Controller and not
shown in the Replay Log in VuGen. How can you accomplish this?
A. Enable the automatic transaction in the Run-time settings
B. Manually add transactions to each step from the Tree view
C. Add a transaction to each page, using the transactions sub-task
D. Select the option from the Tools menu to add transaction to each step in the Script view
Question - 9
You want to emulate a call center for an airline. All representatives login in the morning, perform
their business processes, and log out at night. In one day, a representative will Create 40 flight
reservations, Modify 10 flight reservations, and Search for 20 flight reservations. A representative
cannot perform a Modify without performing a Search first. Which run logic would satisfy the load
testing goal?
A. Create - 67%
Search - 16%
Block0 - 17%
Search
Modify
B. Create - 57%
Search - 29%
Block0 - 14%
Search
Modify
C. Create - 57%
Search - 29%
Modify - 14%
D. Create - 67%
Search - 16%
Modify - 17%
Question - 10
Where do you define an Auto Correlation rule?
A. Test settings
B. General options
C. Run-time settings
D. Recording options
Question - 11
Examination: HP Virtual User Generator Software Exam Code: HP0-M19
Page 3 of 10
You want to create a Microsoft Word document for your web (HTTP/HTML) script that provides a
list of transactions, rendezvous, parameters and step descriptions. How can this be accomplished?
A. Create a Business Process Report in VuGen
B. Create a Microsoft Word Report from Analysis
C. Select the option to export .usr file to a Microsoft Word document
D. Copy the information in the .usr file, and paste it into a Microsoft Word document
Question - 12
You recorded a new script and then realized you failed to turn on the Enable correlation during
recording option. What should you do?
A. Regenerate the script
B. Re-record the script again
C. Highlight the entire script and press the Correlation button on the toolbar
D. Copy and paste the script to a new script with the Correlation option enabled
Question - 13
When modifying the Properties for a Block in the Run-time settings?Run Logic, which Run Logic
options are available? (Select two.)
A. File
B. Unique
C. Random
D. Sequential
E. Same Line As
F. Iteration Number
Question - 14
What will happen when you set the animated run delay to 5,000 milliseconds?
A. When replaying the script, the Run-time Viewer will pause for 5 seconds when an error has
occurred.
B. When replaying the script, the Replay Log will only display the last 5 seconds of logging
information.
C. When the script is replayed, the Run-time Viewer will display 5 seconds behind the current
line being executed.
D. When replaying the script, a line will execute, pause for 5 seconds, execute the next line of
code, pause for 5 seconds, and so on.
Question - 15
What is the purpose of the atoi function?
A. Retrieves the length of a string
B. Concatenates two string values
C. Converts a string to an integer value
D. Converts an integer to a string value
Question - 16
Which parameter type will always have the value of one when replayed in VuGen?
A. Vuser ID
B. Group Name
C. Iteration Number
D. Random Number
Question - 17
What must you do before attempting to automatically correlate after recording?
A. Enable the Auto Correlation feature
B. Play back the script at least one time
C. Ensure the snapshots are visible in the Tree view
D. Add the web_auto_correlation function to the global.h section
Question - 18
When do you need to add correlation to your script?
Examination: HP Virtual User Generator Software Exam Code: HP0-M19
Page 4 of 10
A. Prior to every test run
B. Any time you need to vary user input data
C. Any time there are multiple page loads in a script
D. Any time dynamic data returned from the server appears in the script
Question - 19
One reason for parameterizing data in a script is to vary one value for an object when another
object on the application changes. A common example is username and password. Varying the
username requires you to change the password. What is this type of parameterization?
A. Data Caching
B. Date Constraint
C. Unique Constraint
D. Data Dependency
Question - 20
What is the purpose of the strcat function?
A. Joins two strings
B. Compares two strings
C. Returns the length of a string
D. Copies one string to another string
Question - 21
Which web protocol recording level always generates the web_submit_data function?
A. ICA
B. URL
C. RDP
D. HTML
Question - 22
Which function marks the beginning of a measurement of elapsed time?
A. lr_start_transaction
B. lr_begin_transaction
C. web_start_transaction
D. web_begin_transaction
Question - 23
What is the output of the following code snippet?
char string[] = esting
lr_output_message (answer is: %u strlen(string));
A. Answer is: 7
B. Answer is: 8
C. Answer is: 9
D. Answer is: 10
Question - 24
What is the script view in VuGen?
A. A text-based view that lists the actions of the Vuser as API functions
B. A text-based view that displays the client request and server response
C. An icon-based view that represents what the client received from the server D.
An icon-based view that shows each step and the corresponding screenshots
Question - 25
What is one advantage of the Script view?
A. Allows you to see a snapshot of each page
B. Allows you to use the script documentation
C. Allows you to insert transactions through the task menu
D. Allows you to add logic using functions and control statements
Examination: HP Virtual User Generator Software Exam Code: HP0-M19
Page 5 of 10
Question - 26
Which function allows you to register a search for a text string for the next Action function?
A. web_reg_text
B. web_reg_find
C. web_reg_save_find
D. web_reg_save_param
Question - 27
Which function allows you to exit from the script, action, or iteration?
A. lr_exit
B. web_exit
C. lr_exit_test
D. web_exit_run
Question - 28
Which keyword is a conditional statement?
A. If
B. For
C. Do
D. While
Question - 29
What is the common function used to display messages in the Replay Log?
A. lr_eval_string
B. lr_save_string
C. lr_set_debug_level
D. lr_output_message
Question - 30
During which stage is it recommended that the visual cues for verification be established?
A. During the scripting stage
B. During the planning stage
C. During the recording stage
D. During the execution stage
Question - 31
You want to loop through a block of code 10 times using the for loop. What would accomplish
this?
A. For (i = 0; i < 10; i--) B. For (i = 1; i < 10; i--) C. For (i = 1; i < 10; i++) D. For (i = 1; i <= 10; i++) Question - 32 When performing a manual correlation, where do you search for the dynamic value? A. Script view B. Recording Log C. Tree view -> Client Request
D. Tree view -> Server Response
Question - 33
Which web protocol recording level generates the web_submit_form function?
A. ICA
B. URL
C. RDP
D. HTML
Question - 34
Examination: HP Virtual User Generator Software Exam Code: HP0-M19
Page 6 of 10
Which type of parameter can use the parameter simulation?
A. File
B. Date/Time
C. Unique Number
D. Random Number
Question - 35
What is the output of the following code snippet?
int i = 10;
lr_output_message (answer is: %d --i);
A. Answer is: 1
B. Answer is: 9
C. Answer is: 10
D. The code snippet is invalid.
Question - 36
What is the local operator used for AND?
A. ||
B. - -
C. &&
D. ++
Question - 37
You want to prevent VuGen from generating any lr_think_time functions in your script. What can
be modified to accomplish this?
A. Modify the Run-time settings and select Ignore think time
B. Modify the Run-time settings and select Multiply recorded think time by 0
C. Modify the Recording options and deselect the Generate think time greater than threshold
D. Modify the Recording options and deselect the Generate fexed think time after end transaction
Question - 38
You want to send a message to the log file, Replay Log, and Controller Output window. Which
function should you use?
A. lr_log_message
B. lr_error_message
C. lr_set_debug_level
D. lr_vuser_status_message
Question - 39
What is the programming term for a value that cannot be changed?
A. Variable
B. Function
C. Operator
D. Constant
E. Statement
F. Consistent
Question - 40
Which arithmetic operator is used to increment the value of a variable by one?
A. ||
B. - -
C. &&
D. ++
Question - 41
You want to have your script always check for the following text on every page: sorry. Portlet is
currently unavailable. Please try again later. What is the most efficient way to accomplish this?
A. Create a ContentCheck rule for the text
B. Add an Environment Check for the text
Examination: HP Virtual User Generator Software Exam Code: HP0-M19
Page 7 of 10
C. Add a text area checkpoint on every page D.
Add a verification checkpoint on every page
Question - 42
Where should you add a web_reg_save_param function to a script?
A. In the global.h section
B. Before the step that contains the dynamic value
C. Before the step that retrieves the dynamic value
D. At the beginning of the action section that contains the dynamic value
Question - 43
Which function allows you to select the next available parameter?
A. lr_next_value
B. web_next_param
C. lr_advance_param
D. web_advance_parameter
Question - 44
Which function allows you to capture dynamic values returned from the server?
A. web_reg_find
B. web_reg_save_find
C. web_reg_save_value
D. web_reg_save_param
Question - 45
What is the programming term for a series of statements grouped together to perform a specific
task?
A. Variable B.
Function C.
Operator D.
Constant E.
Statement
F. Consistent
Question - 46
What is the programming term for different values at different times?
A. Variable
B. Function
C. Operator
D. Constant
E. Statement
F. Consistent
Question - 47
Which characters are used to comment a single line?
A. //
B. \\
C. /*
D. */
Question - 48
Which function marks the ending of a measurement of elapsed time?
A. lr_end_transaction
B. web_end_transaction
C. lr_complete_transaction
D. web_complete_transaction
Question - 49
Which type of script is a lower level that records in Analog mode when using the web protocol in
Examination: HP Virtual User Generator Software Exam Code: HP0-M19
Page 8 of 10
VuGen?
A. URL
B.
HTML
C. ANSI C
D. Winsock
Question - 50
What is the file extension for the script file that is opened by VuGen?
A. .c
B. .txt
C. .usr
D. .cor
Question - 51
Exhibit
Which tab is shown in the VuGen Output window?
A. Replay Log
B. Run-time Data
C. Generation Log
D. Parameter Simulator
Question - 52
Which type of script is a higher level that records in Browser or Context Sensitive mode when
using the web protocol in VuGen?
A. URL
B. HTML
C. ANSI C
D. Winsock
Question - 53
What is used as an end-to-end measurement of time elapsed when one or more steps in a
business process have been completed?
A. Action
B. Function
C. Component
D. Transaction
Question - 54
Which VuGen view guides you through the steps in script creation?
A. Tree view
B. Task view
C. Script view
D. Thumbnail view
Question - 55
Exhibit
Examination: HP Virtual User Generator Software Exam Code: HP0-M19
Page 9 of 10
What is the highlighted section of the Workflow Wizard called?
A. Task pane
B. Output pane
C. Thumbnail pane
D. Information pane
Question - 56
Which run-time setting node is available to all protocols?
A. General
B. Browser
C. Network
D. Internet Protocol
Question - 57
Exhibit
The image highlights a button on the VuGen floating toolbar. Which function is added to your
script when you click on this button?
Examination: HP Virtual User Generator Software Exam Code: HP0-M19
Page 10 of 10
A. web_find
B. web_reg_find
C. web_reg_dialog
D. web_reg_save_param
Question - 58
Which programming language is used for the web Vuser type in VuGen?
A. TSL
B. Java
C. HTML
D. ANSI C
E. VBScript
Question - 59
When performing a manual correlation, where do you search for the dynamic value?
A. Script view
B. Recording Log
C. Tree view -> Client Request
D. Tree view -> Server Response
Question - 60
Exhibit
The screen shot is an example of which debugging tool?
A. Replay Log
B. Replay Summary
C. Run-time Viewer
D. Test Results Window

Uninstall a Software Using VB Script

Uninstall a Software Using VB Script

To Run QTP Script from CMD Line - Sample code

To Run QTP Script from CMD Line - Sample code

Monday, July 19, 2010

Uninstall a Software Using VB Script

Uninstall a software using vbscript , QTP
This works for uninstalling most applications. In this example I will show how AutoCAD 2005 can be uninstalled using a VBScript. Open Regedit and look in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall search for the application and find a the product code that is in GUID format looking like this: {5783F2D7-0301-0409-0002-0060B0CE6BBA} It might be something else for you. The code below will uninstall AutoCAD 2005 as well as Express Tools. Copy the code below into Notepad and give the file the extension vbs.on error resume next
Set WshShell = CreateObject(”WScript.Shell”)
‘ Uninstall Express Tools
WshShell.Run “msiexec /x {5783F2D7-0311-0409-0000-0060B0CE6BBA} /q”,1,true
‘ Uninstall AutoCAD 2005
WshShell.Run “msiexec /x {5783F2D7-0301-0409-0002-0060B0CE6BBA} /q”,1,true
Versioning *. In earlier of HP QTP and HP Quality Center, few options version control are available if your Quality Center server had the Version Control Add-ins, who worked with tools from third-party version control for the audit of release. However, version control is fully integrated with Quality Center and the site administrator can enable the version control on a per project basis.

When QTP is connected to a Quality Center project with the support of version control, you can check in any QTP asset or into or out of the version control database.

Baselining *. In Quality Center, a project administrator can create baselines that provide “snapshots” of a project at different stages of development. In the Management module Libraries-tab, the administrator first creates a library, which specifies the root folder from which to import the data. The administrator then creates the actual base line, which includes the last check in versions of all assets included in the library. The administrator can also import data reference and share all other projects Quality Center.

When a project reaches a milestone in the life cycle of the project, the administrator can create a new baseline of library files there.

In HP Quality Center, these baselines can be viewed and compared in their entirety. In QuickTest, you can view, extract, or compare different assets recorded in any standard reference library. This allows you to consider an asset as it appeared at a particular stage of the timeline of the project.

Please Note:

Baselines are supported in HP Quality Center 10.00 Enterprise and Premier editions only. They are not supported in HP Quality Center Starter edition.

Monday, September 28, 2009

Overview of BPT in QC

Business Components module:
Location where components are stored.
Test Plan module:
Location where test scripts are created and stored.
Location where Components are requested.
Test Lab module:
Location where test scripts are executed.


Requesting Components:
Create a new test in QC’s Test Plan module.
Navigate to the “Test Script” tab.
Click the “New Component request” button.
Fill in the new component request form.
Wait for Component status to become “Ready”.

Who will be using BPT?

Groups of BPT Users:
1.Subject Matter Experts (SME)
2.Automation Experts

Subject Matter Experts (SME):This is defined as a tester who is very knowledgeable with the AUT and capable of writing highly detailed manual test cases.
The Role of the SME is to:
Write exact test steps required for the component to playback and verify steps (must include data to use).
Request for Components to be automated.
Create the BPT test script. This will be done by adding components to the test script.
Execute BPT test scripts.
Gather test results.

Automation Expert:This is the person who will be using QTP to automate Components.
The Role of the Automation Expert:
Convert Manual Components into Automated Components.
Update and Maintain Automated Components.

When Should Components Not be Created?

One time testing.
Need to test ASAP.
Steps will not be reused *.
Expected results are not predictable.
AUT’s objects/business rules keep changing.
Cosmetic verifications (color, font…)

When Should Components be Created?

When steps will be repeated - even if the data is different for each iteration. The more repeatable, the better.
When the AUT is stable.

What is BPT - Business Process Testing?

Business Process Testing (BPT) is Mercury’s tool and concept which allows inexperienced automaters to easily create automation test scripts by piecing together reusable business components.
Components are a group of test steps that can be used in multiple test cases as well as in the same test case.
Components are seen in QC as icons (that look like pieces from a jig saw puzzle) but they contain QTP code.
In general, each screen/page in the AUT (Application Under Test) will have just one component created for it.