Next: , Previous: Using Test Scripter for creating scripted test cases, Up: Using Test Scripter for creating scripted test cases


5.1 Test Scripter test case file

The Test Scripter test case file defines the commands to be executed in a test case described with a simple scripting language. The test case file may contain several test cases, the descriptions of which start with the tag [Test] and end with the tag [Endtest]. The test case is executed sequentially line by line. The test case itself is described with keywords, arguments and argument value pairs between the start and end tags. An example of a test case is described below.

     [Test]
     title Create, print, run example and delete
     createx TestScriptClass testobj
     print Call Example method
     testobj Example pa ra me ters
     print Example method called, delete instance
     delete testobj
     [Endtest]

The test case title must be given after the title keyword on the first line of the test case definition. In the example above, the create keyword creates a new instance of TestScriptClass, which is named test. The print keyword is used to print information to the UI. The fourth line of the example test case executes the Example method of the test object with four parameters: pa, ra, me and ters. The delete keyword is used to delete the test object. Test Scripter's test case file and test module initialization file may contain macro definitions used in test cases. Macros are defined inside a define section started with [Define] tag ended with [Enddefine] tag, for example:

     [Define]
     ENOERR 0
     [Enddefine]