Access Keys:
Skip to content (Access Key - 0)
Log in (Access Key - 5)



Toggle Sidebar

addLocationStrategy-action-selcore

@since Molybenum 0.7.1 (Selenium Core 0.8.3)

API Doc

addLocationStrategy (strategyName, functionDefinition)

(inherited from Selenium Core)

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 ininWindow: the currently selected windowinDocument: 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);
last edited on Dec 05, 2008 13:47
Adaptavist Theme Builder Powered by Atlassian Confluence