I have recorded a series of small test (record/play) working from the main window of my application. All the test are working properly. The individual test work from pushbuttons that take you to associated part of the program. I now need to write scripts to link these test together to run the entire application as one test. Can someone explain how I should plan on going about this?
Recommended is: For each testcase, there should only be one Verification statement.
In addition to what Rick had suggested already, f you plan to merge 5 small test cases into 1 leaving one verification statement at the end, you can also do "cut and paste". Cut all the lines of codes from test cases 1-4 and paste them into test case 5 then delete test cases 1-4. Note: if this is what you plan to do most of the time, you may want to play around with Record/Actions instead of Record/Testcases so you don't have to worry about the merging of testcases.
There are three ways I know of that will accomplish this task.
(1) write a main function in your test and call these individual test casses. These test casses can be part of an include file that you use in the body of the main script.
When you include a main routine in your code ONLY tests that are called via main will be executed (sounds like the tests commited a crime!) .. here is an example:
(2) And this is my favorite .. change the test cases into functions. Put these functions into really descriptive .inc files.
I usually have libraries of .inc files that have project names describing them.
Then instead of calling test casses that do the same stuff over and over I chop up big areas of test functionality, into functions.
I usually have a bunch of parameters to the functions to customize what the functions do.
This takes time and experiance but I think this is eventually what you want to do.
(3) Oh and there is TestOrganizer. This is "the way" a bunch of Test organizations run well defined test casses (you could include the second technique into this philosophy). I don't use it myself .. but that doesn't mean you shouldn't.
[This message has been edited by rick_weth (edited 12-05-2000).]
related to the one verification idea. I use a function called VerifySafe to compare two values. It uses do..except to trap the error and report it. The test continues, however, so you can do multiple verifications in one test, each on a single line.
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by John Green: related to the one verification idea. I use a function called VerifySafe to compare two values. It uses do..except to trap the error and report it. The test continues, however, so you can do multiple verifications in one test, each on a single line.
Hope this helps
I use a similar technique, using a combination of functions and testcases to make a full test. This allows for error trapping either by do...except or by the default recovery system if an un-recovereable error occurs. The benefits I have acheived from this method are greater code re-use and less maintenance time.