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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!
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!
Hello @snhatton,
Thank you for the very helpful reply! Using VAR PERSISTENT RETAIN is a great idea!