Skip to content

Verify Text in a File: verifytext

The Verify Text In A File function checks whether a specified text exists in a given text file. If the text is found, the function returns true; otherwise, it returns false. The result is stored in the variable defined in the Element Key, allowing it to be used in subsequent automation steps.

Note: Ensure that the file being used is not open during the execution of the Case to avoid errors or conflicts.

Example: Suppose you have a text file named LogFile.txt located in **C:\Logs**. You need to check if the text “Error 404: Not Found” is present in this file.

Steps to Configure

  1. Add a new step in the automation workflow.
  2. Select Set a Variable Value from the Action dropdown.
  3. Enter a variable name in Element Key (e.g., TextFound) to store the result.
  4. Click on Form, select Functions, and choose VERIFYTEXT function.
  5. Provide the following parameters:
    • File Path: C:\Logs\LogFile.txt
    • Text: “Error 404: Not Found”
  6. Click Save.

Note: While the steps for adding an Action are identical in both views, the display of the steps changes:

scrn-verify-text-tabular-view
Tabular View
scrn-verify-text-card-view
Card View

Outcome on Execution:

  • If the file contains the specified text, the variable defined in the Element Key field, e.g., TextFound will store true.
  • If the text is not found, TextFound will store false.
  • You can reference this variable in automation using the syntax ${VariableName} (e.g., ${TextFound})

Back To Top