The ATEasy Test Executive provides a way for users to check and uncheck a Task or a Test by clicking on the Tests pane check boxes. The Tests pane displays a tree control (TreeView) nodes that represents a Program, Task or Test. This article describes how to check and disable a TreeView node to force a Task or a Test to run and to prevent the user from un-checking the node.
The example assumes you are running a program with a task ID "SystemBIT" and we want to prevent users from un-checking it. The code can be placed in Program.OnInit():
1. Define a program variable:
node: MSComctlLib.Node
2. Insert the following cod to the Program.OnInit() event:
! force task with an id of "SystemBit" to run, prevent the user from un-checking it
! find the node for SystemBIT, replace this name with your task ID
node=TestExec.m_frmMain.FindNode(Program, Program.Tests("SystemBIT"))
! check the node
TestExec.CheckTreeNode(node)
! prevent the user from un-checking it
TestExec.SetNodeData(node, ateNodeFieldDisable, True)