Returns the name of the current Test.
[ sTestName = ] GetTestName ( )
The GetTestName procedure syntax has the following parts:
Name |
Type |
Description |
sTestName |
BString |
Name of current Test |
The name is defined in the Task/Test Property page. The test name can be set/accessed via the internal variable Test and its property Name as Test.Name.
If no Test is currently running (for example, while ATEasy is executing OnInitProgram), an empty string is returned.
The following example aborts the program if a Test that begins with the word "Critical" fails.
OnEndTest()
{
sTestName=GetTestName( )
If (sTestName, 0, 8) = "Critical" Then
If TestStatus>PASS Then
Print GetLogString()
Print "Aborting..."
OnAbortProgram()
Abort()
Endif
Endif
}