Test Manager - Having a user value persist from one execution to the next

ckh1
2023-05-05
2023-05-08
  • ckh1 - 2023-05-05

    Hello,
    It is possible to get a string value from the user when a Test Manager test script is executed. But is there a way to store the string value that the user entered so that in subsequent executions it will use the value the user entered? (So it's like a Test Manager test script variable that persists so that each time the script executes, it defaults to the value that was entered the last time the script was executed.)

    For example (just for the purpose of this discussion), let's say a test script runs and uses a dialog box to prompt the user for their name. The first time it executes, the user's name text field on the dialog box will be blank. Then, on each execution after the first one, user's name text field on the dialog box will contain the name that the user entered on the previous execution of the script.

    Thanks for any helpful ideas!

     
  • snhatton - 2023-05-05

    My approach/recommendation would be: create a function block designed to pair with the visualization dialog pop-up. Declare a string variable inside of the function block to store the value of the user input. Set this variable as VAR PERSISTENT RETAIN. You will either need to add a persistentVars variable list to manage the persistent data, or you will need to use the application composer persistence manager. Application composer is a licensed product, but the persistence manager plug-in is free to use. Add a boolean value to "set" the variable to the user input value. You will then need to declare an instance of the function block in a program POU, and then call this instance in the implementation area. You can then use the write variable command from test manager to write specific values to the function block instance directly. I hope this helps!

     
  • ckh1 - 2023-05-08

    Hello @snhatton,
    Thank you for the very helpful reply! Using VAR PERSISTENT RETAIN is a great idea!

     

Log in to post a comment.