Class 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.
  • 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