XPath Basic Concepts

Silk Test Classic supports a subset of the XPath query language. For additional information about XPath, see http://www.w3.org/TR/xpath20/.

XPath expressions rely on the current context, the position of the object in the hierarchy on which the Find method was invoked. All XPath expressions depend on this position, much like a file system. For example:
  • "//Shell" finds all shells in any hierarchy starting from the current context.
  • "Shell" finds all shells that are direct children of the current context.

Additionally, some XPath expressions are context sensitive. For example, myWindow.find(xPath) makes myWindow the current context.

Silk Test Classic provides an alternative to using Find or FindAll functions in scripts that use XPath queries. You can use locator keywords in an INC file to create scripts that use dynamic object recognition and window declarations.