- 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
- storeCookie ( variableName )
- Return all cookies of the current page under test.
- Returns:
- all cookies of the current page under test
- 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
- storeElementHeight ( locator, variableName )
- Retrieves the height of an elementArguments:
- 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
- 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)
- storeElementPositionLeft ( locator, variableName )
- Retrieves the horizontal position of an elementArguments:
- 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.
- storeElementPositionTop ( locator, variableName )
- Retrieves the vertical position of an elementArguments:
- 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.
- storeElementWidth ( locator, variableName )
- Retrieves the width of an elementArguments:
- 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
- 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, andwindow
will refer to the top-level runner test window, not the window of your application.
If you need a reference to the window of your application, you can refer tothis.browserbot.getCurrentWindow()
and if you need to use a locator to refer to a single element in your application page, you can usethis.page().findElement("foo")
where "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
- 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
Pages
- Training Details
- Manual + QTP + Selenium
- QTP Scripting for BEGINNERs
- QTP INTERMEDIATE
- EXPERT QTP
- VB Script
- Encrypting a String in QTP
- QTP Scripts
- QTP questions and answers
- Selenium Code Links
- Selenium Framework
- Java OOPs Concepts
- JDBC Connection
- TestNG Build.xml code
- pom.xml
- CONFIGURE ECLIPSE WITH CUCUMBER
- SQL Commands
- EVENT LISTENERS IN SELENIUM WEBDRIVER
- ContactUs
Total Pageviews
Monday, 17 December 2012
Selenium Accessors part 4
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment