public class XPathLocator extends AbstractLocator implements Locator
Locator
that uses XPath to locate Node
's
For more information on XPath look here:
For a tutorial on XPath look here:
http://www.w3schools.com/xpath/default.asp
http://www.zvon.org/xxl/XPathTutorial/General/examples.html
NOTE : Locator
s are one shot objects. A call to Locator.getNodes()
should return the same Nodes every time it is called. Even if the underlying
data source has changed (for example the WebTester page has changed) the Locator
MUST return the same data.
AbstractLocator.LocatorTextOperation
nodes, originalWebResponse, tester
Constructor and Description |
---|
XPathLocator(Node startNode,
String xPathExpressionStr)
|
XPathLocator(net.sourceforge.jwebunit.WebTester tester,
String xPathExpressionStr)
Locates
Node 's using the specified WebTester |
Modifier and Type | Method and Description |
---|---|
Node[] |
getNodes()
A
Locator may return 0 nodes, 1 node or multiple nodes. |
String |
toString()
A meaningful "debugging" representation of this Locator to help when test fail.
|
allMatches, betterNode, containsNode, exists, getDOM, getHTML, getHTML, getNode, getNodesTextImpl, getNodeTextImpl, getRawText, getRawText, getText, getText, getWebResponse, hasNodes, iterator, toStringImpl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
allMatches, exists, getHTML, getHTML, getNode, getRawText, getRawText, getText, getText, hasNodes, iterator
public XPathLocator(net.sourceforge.jwebunit.WebTester tester, String xPathExpressionStr)
Node
's using the specified WebTester
tester
- the WebTester in playxPathExpressionStr
- the xpath stringRuntimeException
- if the xPathExpressionStr cannot be compiled into valid XPATHpublic XPathLocator(Node startNode, String xPathExpressionStr)
startNode
- the Node
to start atxPathExpressionStr
- the xpath stringRuntimeException
- if the xPathExpressionStr cannot be compiled into valid XPATHpublic Node[] getNodes()
Locator
Locator
may return 0 nodes, 1 node or multiple nodes.
Copyright © 2002-2016 Atlassian. All Rights Reserved.