Pre-General Availability: 2024-09-02

Add Validation to a Robot Action

After you provide the input details for a robot action, Oracle Integration creates prevalidation for the UI element(s) that you selected. If needed, you can add more prevalidation and postvalidation. Validation can be for the visibility or enabled state of a UI control or for a specific wait time.

The default prevalidation ensures that the UI control from the input action is visible before proceeding with the action. For example, if the input for a click element action is a Submit button, the validation allows the action to start only after the Submit button is visible. If the action must also wait until the Submit button is enabled, add prevalidation for that requirement.

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

  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 the robot action by selecting one of the following tabs:
    • To add validation that occurs before the robot performs an action, select the Pre Validate tab.

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

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

    You can create a page state on another robot action or from the canvas. See Create a Page State.

    Select more page states if needed, and then select OK. You're now finished adding validation.

    If you haven't create a page state for the action, continue to the next step.

  5. Add validation for the robot action.

    First, you create a page state, which is a container for one or more validation checks. Then, 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, you target the button.

      1. In another browser window, open the application that the robot needs to work in.
      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, do not select the UI element while the magnifying lens icon appears and the field is shaded purple. The recorder is still collecting information about the UI element.

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

      4. After the icon changes to a target, the shading turns green, and the mouse icon changes to a hand, 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 this setting, if needed. Reusing a target offers benefits. For example, you can update a target one time, and all robots 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.