Tests in the software engineering industry usually consist of test cases. A test case is either a single logical step or a sequence of steps aimed at testing of a feature, functionality or correct behaviour of an application. An expected result is usually defined. Test cases are often referred to as test scripts and they are usually collected to test suites.
T-Plan Robot Enterprise supports test cases (called "scripts" in T-Plan terminology) and steps. It is expected that test suites are managed on a higher level outside of T-Plan Robot, such as through the test management tools like T-Plan Professional. The scripting language contains two commands, Script and Step:
- Script labels either start or end of a script and associates it with a name or ID. It is intended to be used in pairs of [ "Script <id>start", "Script <id>end"] to define a block of code which executes a particular test case. Any output objects generated inside such a block (screen shots, steps or warnings) are then associated with the script ID and this relationship is reflected in the test result XML data. Script result is pass if all steps it contains pass. As a script block validity ends automatically with the file end or with declaration of another script start, declaration of the script end is optional and may be omitted. The "start" keyword may be omitted as well and the command can be defined as simple as "Script <id>".
- Step defines result of a test step. It represents one atomic instruction of a script (test case). Steps should be located inside a block labeled by the Script command. Steps should be defined to deliver a partial result, in general after a sequence of commands which automate the instruction. Steps are identified by a mandatory name and support a wide range of optional parameters, such as step result, instructions, expected and actual result descriptions and notes.
Script and step structures are reflected both in HTML and XML reports created through the Report command. The XML serves as test report viewable through a web browser as well as a source of test result data suitable for export to 3rd party applications. Reporting functionality will be discussed in details later on in this tutorial.
As an example let's add the script and step structure to the calculator example from previous topic. We suppose that it automates two test cases: verify calculation of "5+5" (script 1) and "10*5" (script 2). For simplicity the steps always returns "pass" because we do not verify the result in any way. Verification of application behaviour is covered extensively in the next chapter of this tutorial.