Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable Scope Question
#1
Solved: 10 Years, 9 Months, 1 Week ago
I am trying to optimize a recorded test.

The existing test assigns employees to departments in a home grown web application.

In expert view, I have tried to define a couple of variables and added an IF statement to test if the current iteration is updating the same department record as the previous iteration. If it is the same department, I just add the next employee. If it is different - then I close the existing department and have the application open the next department before adding the next employee record.

My question pertains to variable scope. Each new iteration does not seem to be able to read the "lastDepartment" variable that was defined during the previous iteration - so when I compare currentDepartment to lastDepartment they never match and the application closes the department record and then just reopens it.

How do I define a variable during the execution of an iteration so that it is available to the next iteration?
Reply
#2
Solved: 10 Years, 9 Months, 1 Week ago
if you take last department value from datasheet, then there is no need to store it to a variable.

you can get the currentrow of the iteration check the value in the datasheet for that row and previous row.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Toungue QTP Test Parameters scope in QC Test Set bfakruddin 0 2,009 02-02-2012, 04:05 PM
Last Post: bfakruddin
  Issue with Variable scope rk_11 1 2,136 03-12-2010, 03:07 PM
Last Post: Saket

Forum Jump:


Users browsing this thread: 1 Guest(s)