Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need variables to keep value from iteration to iteration
#1
Solved: 10 Years, 9 Months ago
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.
Reply
#2
Solved: 10 Years, 9 Months ago
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.
Reply
#3
Solved: 10 Years, 9 Months ago
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Object not found during the 2nd iteration of an Action call in a For loop BGunay 0 854 04-23-2020, 07:08 PM
Last Post: BGunay
  UFT Tool runs more than one iteration always cthossain 2 3,337 02-12-2017, 01:25 PM
Last Post: cthossain
  Function return value is not passed during the 3rd iteration premanand1979 0 2,030 10-16-2014, 09:40 PM
Last Post: premanand1979
  Iteration in Local sheets for UFT11.5 haithamQTP 1 3,007 02-27-2014, 09:12 AM
Last Post: supputuri
  where to declare variables?? ACCBAJPA 0 2,251 10-01-2013, 07:20 PM
Last Post: ACCBAJPA

Forum Jump:


Users browsing this thread: 1 Guest(s)