I am having an issue with the script's iteration. when the script is done, i see iteration 1 and iteration 2. there should be just one iteration.
Below is the snippet(not the entire code). I am using global data table which has two numbers in cell A1 and A2. What's happening is qtp goes thru the for loop and processes both values from the data table. but then it goes back to line 1 which is the browser("Login")... line and tries to open the UI again, but there is aleady an instance running, so qtp throw object disabled error.
I tried putting a browser close statement at the end, but that didn't help. if i use that, then data table values are processed twice, each of them. i tried putting the "exit for" statement in various places towards the end of the script, but i still get two itereation(1st iteration passes and 2nd iteration object is disabled). I also set Run-> Run one iteration only.
I just need loop thru one iteration and stop the script. I don't want it to back to the top again.
What else am i missing? what should i do? Please help, i am running out of ideas.
If found = 1 Then
Reporter.ReportEvent micPass,"Passed","Fund Name and Shares found " & fundname & " " & ShareValue
Reporter.ReportEvent micFail,"Failed","Fund Name and Shares not found " & fundname & " " & ShareValue
Next 'Next number of shares to input
Okay, found out that the File->Settings->Run was set for "run for all rows" changed that to run one iteration only. even though i set the action properties to run for one iteration only, that wasn't enough. Now it seems to be working fine and I didn't have to change my code [img]/images/graemlins/smile.gif[/img]