I have a reusable action which is called 3 times in my script and my script is iterated for 6 times. The reusable action takes its parameter from its local sheet. The local sheet has 2 rows.
The reusable action when called for the 1st and 2nd time in the script it should take the 1st row as the parameter and when called for the 3rd time it should take the 2nd row as parameter. This has been set in the action call property of the reusable action.
However when the script is executed for the 1st iteration it works fine but from the 2nd iteration it fails because reusable action always takes the 2nd row as parameter even thought the action call property setting has been set for that.
The same script works fine in QTP 8 but fails in QTP9.1. Is there any other additional setting which needs to be done for the script to work fine?
I gave up on letting QTP handle my iterations way back in version 8.0.
Ever since then, I use the following:
dtrc = DataTable.GetSheet("xxx").GetRowCount
For intLoop = 1 to dtrc
(put my main script here)
When I call a reusable action, I always run just one iteration and use that same looping code to handle my datatable rows.
When I call a one-shot reusable action such as yours, where I have multiple data rows but only desire to use one row, I specify the row number as either an action parameter or an environment variable and the reusable action doesn't bother with the rowcount or the For..Next loop. Instead, it just sets the row to be whatever value was passed to it and runs just that one iteration.
"The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"
So you mean to specify the row number as an action parameter or an environment varaiable. The action parameter or an environment varaiable can be specified only once for the script. So how can i give 2 row numbers as action parameter or an environment.