OnInitTest Event (ASystem, ADriver, AProgram)

Occurs before each of the program tests executed.

Syntax

Object.OnInitTest()

The OnInitTest event syntax has the following parts:

 

Name

Type

Description

Object

ASystem, ADriver, AProgram

Module object

Comments

The OnInitTest events apply to the Program, Driver and System modules. ATEasy will call first the Program OnInitTestk event then the System Drivers (if exist in your project) and the System. For each testthat ATEasy is about to execute ATEasy will call the OnInitTest event. If the event procedure does not contain code then ATEasy will not call the event.

The following list shows the order of OnInitTest events combined with default output (see ModuleEvents.prj example for more information). After the Program OnInitTest is called, ATEasy will execute the test:

 

* Program.OnInitTask

Task 1 : Untitled Task 1

------------------------------------------

   * System.OnInitTest

   * Driver1.OnInitTest

   * Driver2.OnInitTest

   * Program.OnInitTest

   * Program.OnEndTest

Use the OnInitTest events if you need to initialize your system instruments before each test is executed, to customize the test log or any other code that should be called before a test is executed. If the event returned normally (not ignored by calling Run, Task or Test statements for example) ATEasy will continue to call all the OnInitTestevents for other modules.

Example

The following is an example of one way to use the OnInitTest event:

Program.OnInitTest()

{

! ... program initialization code ...

print "Program "; Program.Name; " has been initialized for running test "; Test.Id

}

Applies to

ASystem, ADriver, AProgram

See Also

OnEndTest, OnInit, OnInitTask, Task Statement, Test Statement, Initialization Events, About Module Events