Micro Focus QTP (UFT) Forums

Full Version: Need variables to keep value from iteration to iteration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need a few variables to keep their values from iteration to iteration. Is there a way to have QTP do this?
Let me explain a bit more about what I'm doing and what I need out of it. Maybe someone will come up with a creative solution.
I have the first few lines of code that navigates to a website and pulls some information needed to run the script. I capture it and store it for use later in the script.
Here's the thing, it only changes once a week or so. So, rather than capturing it on every iteration, I want to capture, store and use it on ALL iterations on the script.
I want to run the first few lines on only the first iteration and keep the values it captured for use in the subsequent iterations.
Hope this helps clarify.
Hi,
You can gather the data and keep it in the DataTable and then export this data table to excel.So next time you can import this excel and use the data already stored.
Create a function file for excel reading and updating.
EX: 1) Create a excel file and put variable name in 1st column and its value in 2nd column.( One time activity)
2) Read all the value from your application.
3) Read the excel file using already created function and compare each variable name and it's value with application.
3) If any mismatch in value between application and excel update the excel with new value
4) else read the existing value or use the application value.

Execution of above function once in a week or before execution of your script is your choice.