We have seen in the previous recipe that Action
can accumulate data by adding information to its Details
field. The Status
field of Action
is set from within the code, generally the Run
method. Our reporting mechanism leverages the fact that the Actions
are objects, and that they will use the native UFT reporter as their target output.
From the File menu, navigate to New | Function Library, or use the Alt + Shift + N shortcut. Save the file as C:\Automation\Lib\lib.Reporter.vbs
.
Write the following code in the function library you created:
Function ReportActionStatus(ByRef p) ' -------------------------------------------------- ' Function : ReportActionStatus ' Purpose : Reports an event to the UFT reporter with the data of the referenced Action ' Args : ByRef p ' Returns : N/A ' -------------------------------------------------- Reporter.ReportEvent GetNormalizedStatus(p.Status.Value...