GetTestName Procedure

Returns the name of the current Test.

Syntax

[ sTestName = ] GetTestName ( )

The GetTestName procedure syntax has the following parts:

 

Name

Type

Description

sTestName

BString

Name of current Test

Comments

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.

Example

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

}

See Also

ATest, AVarTest, GetTaskName, GetTaskNum, GetTestNum