| || |
We recorded a script. We want to replay this script in 3 different
suites. The 3 first data to be entered must be different (because it
sets up an environment for the application to run).
We would like to use exactly the same script (without modification for the data).
We have thought about using an external testdata file. We will have 3 different external testdata files (for each suite) called the same
name, but in different directories. In that case, is it possible to
define a default ''Run'' directory per suite ? (so we could define the
path as ''../datafile_name'', where the 2 dots mean the default ''Run''
How can we do that?
Re: Generic Script
Heres what you do!
Good Programming principles apply.
1) Record a script to set up the environment. Once working, rename the function something other than ''MAIN'' and make sure you have a ''Return Result'' and the end of the script.
I.e. Function Setup() and Save as Function_Library.
2) Record a new script to input the rest of the data. This will be a Driver script.
Call the setup function from the diver.
The function library will contain the functions to insert the 3 data scripts.
This could be contained in 1 or 3 separate scripts. Add functions to the
Function_library as require, this is reusable code.
;call function setup stored in the ;function library
result = setup()
;if else error handling.
if result = 1
LogComment( ''Success :'')
;record new script to &
The Path problem should be very straight forward, set up a variable and assign the path required, pass
it as a parameter to any test suit/function required.
A word of warning, try not to use the same filenames even if they are in diff directories. When Knee deep in code mistakes can easily be made and testing data can be lost. Trust me!.