Class XPath2Assertion

All Implemented Interfaces:
Serializable, Cloneable, Assertion, Searchable, org.apache.jmeter.testelement.TestElement

public class XPath2Assertion extends AbstractScopedAssertion implements Serializable, Assertion
Checks if the result is a well-formed XML content and whether it matches an XPath
See Also:
  • Field Details

  • Constructor Details

    • XPath2Assertion

      public XPath2Assertion()
  • Method Details

    • getResult

      public AssertionResult getResult(SampleResult response)
      Returns the result of the Assertion. Checks if the result is well-formed XML, and that the XPath expression is matched (or not, as the case may be)
      Specified by:
      getResult in interface Assertion
      Parameters:
      response - the SampleResult containing information about the Sample (duration, success, etc)
      Returns:
      the AssertionResult containing the information about whether the assertion passed or failed.
    • getXPathString

      public String getXPathString()
      Get The XPath String that will be used in matching the document
      Returns:
      String xpath String
    • setXPathString

      public void setXPathString(String xpath)
      Set the XPath String this will be used as an xpath
      Parameters:
      xpath - String
    • setNegated

      public void setNegated(boolean negate)
    • isNegated

      public boolean isNegated()
      Negate the XPath test, that is return true if something is not found.
      Returns:
      boolean negated
    • setNamespaces

      public void setNamespaces(String namespaces)
    • getNamespaces

      public String getNamespaces()