Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keep data through multiple iterations
#1
Here is what I have.
I have a script in QTP that runs on a datatable of anywhere from 5 to 100 iterations. At the begining of the script a question is posed to the user. I want the answer to this question to be carried and used on all instances of the script.
Here is the code.
Code:
If Environment("ActionIteration") =1 and Environment("TestIteration") =1 Then intAnswer = _ Msgbox("Would you like to test ****** while running this script?", _ vbYesNo, "Test while running?") If intAnswer = vbYes Then TestEm = "Y" Else TestEm = "N" End If End If
I'd like to have the TestEm value keep for every iteration. How do you do this?

Brian
Reply
#2
No ideas on this? or am I asking the question in the wrong place?
Reply
#3
Hi,

What is the question?
And what is the TestEm?

Can you please elaborate more?
Reply
#4
Create a Dynamic array with the help of Redim with preserve for the variable TestEm in the loop
Exp :
for i = 1 to 100 then
Redim TestEm(i) preserve ....
Reply
#5
I was able to get around this by writing the captured value to an excel sheet on the first iteration only. Then referring to that value with each iteration after.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple rows of test data Bhuvana 0 1,733 01-03-2020, 09:30 PM
Last Post: Bhuvana
  Repeat iterations Until New Value Is Seen in Column1 shayk1985 1 2,362 07-05-2018, 05:52 PM
Last Post: Ankur
  UFT Datatable iterations Studymode 2 4,490 12-12-2017, 11:10 PM
Last Post: Studymode
  Grab multiple line data from log file haziqwebs 0 2,153 10-19-2016, 01:28 PM
Last Post: haziqwebs
  QTP-Re-executing script after completion of all iterations JwalantBhatt0602 1 3,169 03-24-2016, 12:37 AM
Last Post: JwalantBhatt0602

Forum Jump:


Users browsing this thread: 1 Guest(s)