Log tracking

Relevant for: GUI tests and components

If the Windows-based application you are testing uses a supported Java or .NET log framework that includes a UDP appender, you can enable UFT One to receive log messages from that framework and send them to the run results.

Analyzing the log messages that were generated as a result of a particular step can help you pinpoint the causes of unexpected behavior in your application, such as application crashes during automated runs.

Do this by configuring your application's log configuration file, either in the Log Tracking pane of the Settings dialog box, or manually.

For a list of supported log frameworks, see the UFT One Support Matrix.

Manually configure log tracking settings

Verify the following prerequisites:

  • Your Windows-based application must use a Java or .NET log framework that includes a UDP appender.

  • Logging must be enabled on your application. Verify that you know how to enable and disable logging.

  • The log configuration file must be writable.

Back to top

Open the log configuration file and specify preferences

  1. Add an appender-ref ref attribute with the value of QtpUdpAppender to the root element.

  2. Specify the minimum log message level that you want to include in the run results.

    Note: Log tracking messages are available only when viewing the run results in the Run Results Viewer.

    Example:

    ...
    <root>
        <level value="DEBUG" /> 
    ...
        <appender-ref ref="QtpUdpAppender" />
    </root>
  3. Add an appender element and its attributes, as shown in the following example.

                                <appender name="QtpUdpAppender"
      type="log4net.Appender.UdpAppender">
        <remoteAddress value="1.1.1.1" />
        <remotePort value="18081" />
        <encoding value="utf-16" />
        <layout type="log4net.Layout.XmlLayoutSchemaLog4j">
            <prefix value="" />
        </layout>
    </appender>
                            
  4. Note: To enable UFT One to receive log messages, the Add log messages to run results area of the "Log Tracking Pane of the Settings dialog box must also be configured, as described below.

Back to top

Configure the settings in the Log Tracking pane

This step enables UFT One to receive log messages during a run session.

In the Log Tracking pane of the Settings dialog box:

Back to top

Results

During a run session, UFT One receives any log messages that match or exceed the minimum log message level that you specified in the Log Tracking pane and displays them in the run results.

In the run results tree, a node is also inserted for the first message that matches or exceeds the Minimum level to add node to results tree. This node is inserted directly after the step that triggered (or preceded) the relevant log message (according to its timestamp).

Back to top

See also: