Skip to main content

Test Command

Test command is used to test if a condition is true. It returns an error if the condition is false. We can optionally log an error message as well when the condition returns false or an optional message when the test returns true.

The ‘Test’ command is located under the ‘Action’ icon in the command palette (refer the below snapshot)

image-20241021-090113.png

In order to make the optimum use of the ‘Test’ command, we can configure the options as shown in the below screenshot, as per the user requirement.

image-20241021-090201.png

Command Configuration

The configuration screen for the Test command has three tabs viz. Browser, Options, and Text. Use the ‘Browser’ tab to select command XPath and apply selection transformations. Use the ‘Options’ tab to set the command name and other command properties. Use the ‘Text’ tab to navigate to the text of the agent where the command part is present.

image-20241021-090255.png

Command Properties

On the ‘Options’ tab of the command we have two option:

  1. General Settings

  2. Test

image-20241021-090334.png

General Settings → General Command Settings

The ‘General command settings’ section is designed for user customization to give the command a desired name, comment to describe in brief about the usability or requirement for the command and the disabled option to not execute this command at all.

image-20241021-090429.png
  1. Command name: This property specifies the name of the command.

  2. Comments: Provides a field for entering metadata or a brief description regarding the command. These annotations are used internally to provide context for developers or team members. Comments are not part of the exported data and are only used for documentation purposes within the configuration.

  3. Disabled:  This checkbox allows the user to disable the command. When checked, the command is ignored during execution. By default, it is unchecked.

Test → Selected test content

image-20241021-090508.png
  • When test content missing: This option lets the user select one of four actions from a dropdown menu to specify what should happen if the selected test content is missing. The default value is set to "Warn".

    • Fail: If the selected test content is missing, An error message is generated in the logs and the agent fails.

    • Warn: If the selected test content is missing, A warning message is generated in the logs and the agent continues.

    • Ignore: If the selected test content is missing, the agent skips child commands and moves to the next command.

    • Passthrough: If the selected test content is missing, the agent ignores it and continues executing child commands.

  • Selected test content: In this section, the user can view the selected test content in HTML format, displayed within the box. Please note that this HTML content is non-modifiable, meaning the user cannot make changes to it. This feature is particularly intended to allow users to see the selected test element.

Test → Test settings

The ‘Test settings’ section gives users the ability to customize the test conditions based on use cases.

image-20241021-090554.png
  1. Assert selected content: Defines the condition to evaluate based on various options in the dropdown. It helps determine if the extracted value meets the specified criteria, like existence, equality, or comparison.

    1. Exists:
      Returns true if the selection exists on the page. This condition checks for the presence of the element.

    2. Exists And Not Empty:
      Returns true if the selection exists and is not empty, ensuring the element has content.

    3. Not Exists:
      Returns true if the selection does not exist. This checks for the absence of the element.

    4. Not Exists Or Empty:
      Returns true if the selection does not exist or is empty, validating either of those conditions.

    5. Equals:
      Returns true if the value in the selection is equal to the passed value, checking for exact matches.

    6. Not Equals:
      Returns true if the value in the selection is not equal to the passed value, verifying non-matches.

    7. Matches:
      Returns true if the passed value matches the value in the selection, based on a pattern or exact match.

    8. Not Matches:
      Returns true if the passed value does not match the value in the selection, ensuring the values are different.

    9. Contains:
      Returns true if the passed value contains the value in the selection, checking for substring presence.

    10. Not Contains:
      Returns true if the passed value does not contain the value in the selection, ensuring absence of a substring.

    11. Starts With:
      Returns true if the passed value starts with the value in the selection, validating the start of the string.

    12. Not Starts With:
      Returns true if the passed value does not start with the value in the selection, checking for incorrect prefixes.

    13. Ends With:
      Returns true if the passed value ends with the value in the selection, verifying the suffix.

    14. Not Ends With:
      Returns true if the passed value does not end with the value in the selection, ensuring the suffix doesn't match.

    15. Greater Than:
      Returns true if the passed value is greater than the value in the selection, used for numerical comparisons.

    16. Greater Than Or Equals:
      Returns true if the passed value is greater than or equal to the value in the selection, including equal values.

    17. Less Than:
      Returns true if the passed value is less than the value in the selection, used for numerical comparisons.

    18. Less Than Or Equals:
      Returns true if the passed value is less than or equal to the value in the selection, including equal values.

  2. Exit on Failure:
    Determines whether the agent should fail if the condition is not met, controlling how failures are handled.

  3. Custom Failure Message:
    An optional message that is printed when the condition fails, providing more details on the failure.

  4. Report Success:
    Option to print a success message if the condition is met, indicating that the test was successful.

  5. Custom Success Message:
    An optional field that allows for a custom success message to be displayed when the condition succeeds, providing feedback on the success.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.