Using AppVerify with a dynamic variable file (CSV or Excel)

If you would prefer to drive the AppVerify tests with a CSV or Excel file, this article contains details on how to set up and use a dynamic variables file.

Using a dynamic variables file allows you to update the file outside of AppVerify. Once you change from the default static variables, you will use the variables file to add or remove test cases as well as manage variables.

Setting up a Dynamic Global Variables File

Follow these steps to set up a dynamic global variables file.

Edit Variables
  1. On the Test Plans, step 1 page click the icon to the right of the Global Variables line. The Global Variables pop-up appears.
Global Variables

2. Open the Global variables source drop-down and select Dynamic. A pop-up appears asking if you would like to use an existing file, or create a new one.

Add New or Existing Popup

3. If you select use existing, you must enter the full path and file name (e.g. c:\myvariables\addpatient_global.csv). If you select Create New, a CSV file will be created with the global variables names as headers and the default values. The CSV file is named dynamic_global_vars.csv and is created in the ..Automai\Manager\media\rft_dynamic_files\<Name of the test>\ directory.

Global Variables - Dynamic

4. Click the Save icon.

Items to Keep in Mind When Using an Existing File

  • The file must be on the same machine where AppVerify is installed.
  • If you are using an Excel file with multiple sheets, the variables sheet must be the active sheet in the workbook.
  • The file must have headers that match the global variables.
  • You can use an Excel file, even if Excel is not installed on the AppVerify machine. However, you will not be able to edit the file from the machine. You will need to edit it elsewhere and copy it back to the machine.

Once you change to dynamic variables, the variables that display become read only. To change the global variables, you will need to open the file and make the needed changes. Each time you open the Test Plan the application will read the file and display the values from the file.

If you change your mind, you can revert back to static variables by choosing Static from the Global variable source drop-down. The variables will then be editable.

Setting up a Dynamic Process Variables File

Edit Variables
  1. On the Test Plans, step 2 page click the icon to the right of the Selected Process drop-down. The Process Variables pop-up appears.
Process Variables - Static

2. Open the Variables Options drop-down and select Dynamic. A pop-up appears asking if you would like to use an existing file, or create a new one.

Add New or Existing Popup

If you select use existing, you must enter the full path and file name (e.g. c:\myvariables\addpatient_variables.csv). If you select Create New, a CSV file will be created with the process variable names as headers, existing tests as rows and the current variable values. The file is named <group>_<process_name>_dynamic_process_vars.csv and is saved to the ..Automai\Manager\media\rft_dynamic_files\<test name>\ directory.

Generated File Name

3. Click the Save icon.

Items to Keep in Mind When Using an Existing File

  • The file must be on the same machine where AppVerify is installed.
  • If you are using an Excel file with multiple sheets, the variables sheet must be the active sheet in the workbook.
  • The file must have all of the variable headers that exist in the scenario.
  • You can use an Excel file, even if Excel is not installed on the AppVerify machine. However, you will not be able to edit the file from the machine. You will need to edit it elsewhere and copy it back to the machine.

Once you change to dynamic variables, the variables that display become read only. To change the global variables, you will need to open the file and make needed changes. This includes adding new test cases. Each time you open the Test Plan, the application will read the file and display the values from the file.

NOTE - when you are using Dynamic variables, the New and Generate test cases buttons are hidden.

Static vs Dynamic Variables

Tests and test cases are generated from the file instead. Also, the Generate All Test Cases button on Step 1 will no longer function when clicked. Test cases are generated from the file instead.

If you change your mind, you can revert back to static variables by choosing Static from the Variables Options drop-down. The variables will then be editable. and the "New" and "Generate Test Cases" buttons are available. The "Generate All Test Cases" button on step 1 will function again as well.

Test Execution When Using Dynamic Variables

During generation of the test plan run either manually or via a schedule, the run is generated using data from the dynamic file. If set to dynamic process variables, if the variables file has added rows, the additional test cases are generated and executed. If the file has removed rows, those corresponding test cases are not executed.

If your dynamic file is missing one or more variables the default value for the variable will be used for all test cases. If there is not a default value, the variable will be empty.

Adding New Tests

To add a new test to a dynamic file, add a new row and give the new test a name and ID (both are required), then add the needed variable data. The ID can be any value as long as it is a unique value not used for any other test case in the file.

Edited Variables File

Newly added tests appear on step 2 and step 3. You do not need to generate test cases. Existing test cases and their validations are retained.

Process Variables - new test cases added

Removing Tests

To remove a test case, delete the row from the file.

Updating Test Variables

You can update the data in the file at any point. The updates will be reflected in test runs that are generated after the file is saved, and when opening the test plan from the Test Plans page. Runs that were generated before the file was saved will not reflect the changes.