Handle Table Structure Irregularities

Table rows may vary in the number of cells they contain. A common way of dealing with such irregularities is to test the format of each table row. For example, you might want to consider only rows containing a certain number of cells, or only rows containing a specific text.

  1. Follow each For Each Tag step with a Try step.
  2. Configure the Try step to loop through the table rows.

    Each Try step branch handles one format. This can be done by starting each branch with a conditional step with "Try Next Alternative" error handling, for example a Test Tag action that accepts all rows matching some format (written as a pattern).

  3. Follow the conditional step with one or more extraction steps that assume the format accepted by the conditional action.

    It is sometimes possible to combine the conditional step and the extraction; to just try to do the extraction of a format and if it fails, try the next one.

    The following robot uses both approaches.

    Handling table structure irregularities

    Note that the extraction of the second format is a two-step process. Because Try Next Alternative error handling is set up on both steps, the third branch is tried if either of the two steps fails. This represents a fairly complicated condition on the second branch.

    When this robot is run, each branch is executed in turn until one succeeds. This implies that the conditions in later branches do not have to repeat the conditions from earlier branches; it is known that they failed.

    Note You are not required to separate the branches beyond the conditional steps. If two or more branches share extraction steps, you may want to merge those branches after the steps that differ from each other.