Package com.xceptance.xlt.api.actions

# Class AbstractXmlPageAction

java.lang.Object
com.xceptance.xlt.api.actions.AbstractAction
com.xceptance.xlt.api.actions.AbstractWebAction
com.xceptance.xlt.api.actions.AbstractXmlPageAction

public abstract class AbstractXmlPageAction extends AbstractWebAction
AbstractXmlPageAction is the base class for all actions that load an arbitrary XML snippet. The loaded page is parsed and stored internally as a tree of elements. This makes it easy to locate and query/manipulate a certain page element.

- ## Field Summary

  ### Fields inherited from class com.xceptance.xlt.api.actions.AbstractWebAction

  `EMPTY_PARAMETER_LIST`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractXmlPageAction(AbstractWebAction previousAction, String timerName)`
  Creates a new AbstractXmlPageAction object and gives it the passed timer name.
  `protected`
  `AbstractXmlPageAction(String timerName)`
  Creates a new AbstractXmlPageAction object and gives it the passed timer name.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `XmlPage`
  `getXmlPage()`
  Returns the parsed XML page object generated by this action.
  `protected void`
  `loadXMLPage(URL url)`
  Loads the page from the passed URL.
  `protected void`
  `validateHttpResponseCode(int expected)`
  Validates the HTTP response code.

  ### Methods inherited from class com.xceptance.xlt.api.actions.AbstractWebAction

  `addResponseProcessor, closeWebClient, createWebRequestSettings, getPreviousAction, getWebClient, run`

  ### Methods inherited from class com.xceptance.xlt.api.actions.AbstractAction

  `execute, executeThinkTime, getThinkTime, getThinkTimeDeviation, getTimerName, postValidate, preValidate, preValidateSafe, setThinkTime, setThinkTime, setThinkTimeDeviation, setThinkTimeDeviation, setTimerName`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AbstractXmlPageAction

    protected AbstractXmlPageAction(AbstractWebAction previousAction, String timerName)
    Creates a new AbstractXmlPageAction object and gives it the passed timer name. This constructor is typically used for an intermediate action in a sequence of actions, i.e. it has a previous action.
    Parameters:
      `previousAction` - the action that preceded the current action
      `timerName` - the name of the timer that is associated with this action

  - ### AbstractXmlPageAction

    protected AbstractXmlPageAction(String timerName)
    Creates a new AbstractXmlPageAction object and gives it the passed timer name. This constructor is typically used for the first action in a sequence of actions, i.e. it has no previous action.
    Parameters:
      `timerName` - the name of the timer that is associated with this action

- ## Method Details

  - ### getXmlPage

    public XmlPage getXmlPage()
    Returns the parsed XML page object generated by this action.
    Returns:
      the page

  - ### loadXMLPage

    protected void loadXMLPage(URL url) throws Exception
    Loads the page from the passed URL.
    Parameters:
      `url` - the target URL
    Throws:
      `Exception` - if an error occurred while loading the page

  - ### validateHttpResponseCode

    protected void validateHttpResponseCode(int expected) throws Exception
    Validates the HTTP response code.
    Parameters:
      `expected` - the expected HTTP response code
    Throws:
      `Exception` - if the validation against the expected response code failed or no response is available