Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable Scope Question
#1
Solved: 11 Years, 4 Months 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


Messages In This Thread
Variable Scope Question - by morecarl - 11-05-2008, 10:25 PM
RE: Variable Scope Question - by manojmathew1984 - 11-28-2008, 12:36 AM

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

Forum Jump:


Users browsing this thread: 3 Guest(s)