com.atlassian.confluence.it
Class ResponseXPath

java.lang.Object
  extended by com.atlassian.confluence.it.ResponseXPath

public class ResponseXPath
extends Object

Lets you call the WebTester XPath functions without throwing assertion failed errors.


Constructor Summary
ResponseXPath()
           
 
Method Summary
static String getElementAttributeValue(String elementXPath, String attribute)
          Returns the value of an attribute on an element in the current response stored in the WebTester.
static String getElementAttributeValue(String elementXPath, String attribute, net.sourceforge.jwebunit.junit.WebTester webTester)
           
static String getElementText(String elementXPath)
          Returns the inner text of an element in the current response stored in the WebTester.
static String getElementText(String elementXPath, net.sourceforge.jwebunit.junit.WebTester webTester)
           
static boolean hasElement(String elementXPath)
          Returns true if an element in the current response stored in the WebTester matches the given xpath, otherwise returns false.
static boolean hasElement(String elementXPath, net.sourceforge.jwebunit.junit.WebTester webTester)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseXPath

public ResponseXPath()
Method Detail

getElementAttributeValue

public static String getElementAttributeValue(String elementXPath,
                                              String attribute)
Returns the value of an attribute on an element in the current response stored in the WebTester. The element used is the first element specified by executing the xpath expression against the response document. Returns null if either the element or attribute does not exist.

Wraps WebTester.getElementAttributeByXPath(String, String).

Parameters:
elementXPath - the xpath of the element to find
attribute - the name of the attribute whose value will be returned
Returns:
the value of the given attribute on the first element specified by the xpath expression

getElementAttributeValue

public static String getElementAttributeValue(String elementXPath,
                                              String attribute,
                                              net.sourceforge.jwebunit.junit.WebTester webTester)

getElementText

public static String getElementText(String elementXPath)
Returns the inner text of an element in the current response stored in the WebTester. The element used is the first element specified by executing the xpath expression against the response document. Returns null if either the element does not exist.

Wraps WebTester.getElementTextByXPath(String).

Parameters:
elementXPath - the xpath of the element to find
Returns:
the text inside the first element specified by the xpath expression

getElementText

public static String getElementText(String elementXPath,
                                    net.sourceforge.jwebunit.junit.WebTester webTester)

hasElement

public static boolean hasElement(String elementXPath)
Returns true if an element in the current response stored in the WebTester matches the given xpath, otherwise returns false.

Wraps WebTester.assertElementPresentByXPath(String).

Parameters:
elementXPath - the xpath of the element to find
Returns:
true if an element with the given xpath exists, otherwise false

hasElement

public static boolean hasElement(String elementXPath,
                                 net.sourceforge.jwebunit.junit.WebTester webTester)


Copyright © 2003-2013 Atlassian. All Rights Reserved.