Building a test reporter

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.

Getting ready

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.

How to do it...

Write the following code in the function library you created:

Function ReportActionStatus(ByRef p) ' -------------------------------------------------- ' Function : ReportActionStatus ' Purpose : Reports an event to the ...

Get Advanced UFT 12 for Test Engineers Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.