11-05-2008, 10:25 PM
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?
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?