Add Validation to a Robot Action

When you target a UI element in a robot action, Oracle Integration can automatically create prevalidation for it.

Supported Validation

You can add validation that waits to perform the action until the following activities have occurred:

  • A UI control becomes visible.

  • A UI control becomes enabled.

  • A specific amount of time has passed.

About Automatic Prevalidation

Oracle Integration automatically creates prevalidation when you select the Auto create pre validation page states setting. See Tailor Your Building Experience.

Here's what's included and not included in the automatic validation:

  • Included: Confirm that the UI control that you targeted is visible before proceeding with the action.

    For example, you targeted a Submit button, the validation allows the action to start only after the Submit button is visible.

    Because the recorder and low-code tools capture three selectors for each element that you target, the prevalidation condition includes three selectors, one for each element.

  • Not included: Wait until a specific button is enabled, or wait for a specific period of time before proceeding with the next action.

    You can add these checks yourself by following the steps on this page.

All the validation conditions must be met for an action to proceed.

Add Validation to a Robot Action

  1. Open a robot.
  2. On the canvas, find the robot action that requires validation, and double-click it.

    The panel for the action appears.

  3. Choose the type of validation to add:
    • To add validation before the robot performs an action, select the Pre Validate tab.

    • To add validation after the robot performs an action, select the Post Validate tab.

  4. If you already created a page state, select it from the Page state drop-down.

    If you don't need to add any more validation, you're now finished.

  5. If you haven't create a page state already, create it now.

    A page state is a container for one or more validation checks. After creating a page state, you add validation checks to the page state.

    1. Click Create +.
    2. In the Name field, enter a name for the page state, such as Verify that I'm on the order page.
    3. Add a validation condition: Next to Conditions, click Create +.
    4. Fill in the following fields.
      Field Description
      Name

      Enter a name for the validation condition, such as Submit button enabled.

      Message

      Enter the message that appears when the validation condition isn't met before the timeout period elapses. For example, The Submit button did not become enabled within the specified 30-second timeout period. If the condition times out, the robot fails, and this message appears in the activity stream.

      Strategy

      Select one of the following options:

      • Element: Add validation that is related to the visibility or enabled state of a UI element.
      • Fixed Time: Add a predetermined wait period.

      Caution: The Fixed Time validation introduces explicit slowness. Consider your requirements carefully before adding this validation, and use it sparingly.

      State

      (Visible only if you select Element for the Strategy)

      Select one of the following options:

      • Visible: The validation condition checks whether a UI element appears before the action proceeds.
      • Enabled: The validation condition checks whether a UI element is clickable before the action proceeds.
      Timeout (seconds)

      Enter the timeout period for the validation.

      • If you selected Element for the Strategy: Enter the maximum amount of time to wait for the condition to become true. The action runs as soon as the condition becomes true; this value is simply the maximum amount of time to wait before the robot instance fails.
      • If you selected Fixed Time for the Strategy: Enter the specific wait time that the robot waits every time it runs.
    5. If you selected Element for the Strategy): Next to Selectors, click Create +, and identify the UI control for the validation.

      For example, if the validation ensures that a button is visible, target the button.

      1. In another browser window or tab, open the application where the robot works.
      2. In Oracle Integration, click within the Value field, and select Target a page element Target a page element.
      3. In the application that the browser needs to work in, point to the UI control that you're adding validation to, but don't select the UI control yet.

        For example, if the field is shaded purple and the magnifying lens icon appears, don't click yet. The recorder is still collecting information.

        A User ID field is shaded purple, and a magnifying lens icon appears above it

      4. Wait for the shading to turn green and the mouse icon to change to a hand, and then select the UI element.

        A User ID field is shaded green, and a target icon appears above it

        For more tips, see Quick Start for Building Robots.

        The recorder enters a value in the Value field in Oracle Integration.

        Tip:

        Your settings determine whether Oracle Integration reuses targets for previously selected UI controls. You can override these settings, if needed. Reusing a target offers benefits. For example, you can update a target one time, and all actions that use the target get the update.
    6. Next to Create page state, click OK.
  6. If needed, repeat the previous steps to add more validation.
If you need to update a page state or its conditions, see Update a Page State.