How to enable Unified Functional Testing (UFT) logs?
Product - Version:
Unified Functional Testing;
OS:
Updated :
2016-Jul-06
Summary :
UFT Logs
Previously, QuickTest Professional used tool <QTP>\bin\ClientLogs.exe utility, setting up its section called "QTP", however for UFT, this option does not capture any logs.
So how to capture UFT logs considering the above?
Solution
IMPORTANT: Review entire below summary (and is supplementary sections indicated) before implementing steps.
- Close UFT.exe, UFTRemoteAgent.exe, AQTRmtAgent.exe and QTAutomationAgent.exe
- Locate tool's "Logs" directory/folder (see A section below)
- Configure all necessary config.xml files (see B section below)
- Clear (or delete contents of) "Logs" directory/folder.
- Reproduce situation. If reproduction requires multiple repetitions/iterations, repeat steps 4 - 5.
Note: Enabling logs as suggested may generate larger logs files, so minimizing the tasks done on UFT to reproduce, and clearing the logs before each attempt of reproduction, may help collecting more accurate information from such logs.
- (If possible) Collect date and time when issue. IMPORTANT NOTE: Required when analyzing large amount of logs and/or very lengthy logs.
- Compress logs to ZIP
The UFT log files generated from below steps should get created by default under the following path:
%APPDATA%\Hewlett-Packard\UFT\Logs
or
C:\Users\<username>\AppData\Roaming\Hewlett-Packard\UFT\Logs
To navigate to above, go to "Start" > "Run" and type above path.
Note: if, and only IF, above path is not found, then:
- Open desired log configuration file (*.xml)
- Search below tag/structure:
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="${APPDATA}\Hewlett-Packard\UFT\Logs\HP.UFT.log" /> - Confirm "file value" is pointing to desired path.
Note: Above is pointing to default mentioned before/above: %APPDATA%\Hewlett-Packard\UFT\Logs - (Optional) If desired, change path to another location and save file, for example:
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="C:\MyLogs\HP.UFT.log" />
- Ensure having Read/Write permissions on <UFT>\bin
- Create copy/backup of <UFT>\bin\log.config.xml.
Note: If you do not have writing permissions
- Open text editor: <UFT>\bin\log.config.xml
- If the reproduction scenario is random and/or requires long executions, increase the value of maxSizeRollBackups accordingly:
- Hours long: <maxSizeRollBackups value="100" />
- Days long: <maxSizeRollBackups value="1000" />
- Change the "level value" under "root" tag to DEBUG (instead of ERROR):
<root>
<level value="DEBUG" />
<appender-ref ref="RollingFileAppender" />
</root>
- Make sure all appender-ref element values are set to "RollingFileAppender":
<root>
<level value="DEBUG" />
<appender-ref ref="RollingFileAppender" />
</root>
- If involving API scripts, add logger/tag named "HP.ST" as below:
<logger name="HP.ST">
<priority value="ALL"/>
<level value="ALL"/>
<appender-ref ref="RollingLogFileAppender"/>
<appender-ref ref="ColoredConsoleAppender" />
<appender-ref ref="Recorder" />
<appender-ref ref="DebugAppender" />
<appender-ref ref="FileAppender" />
</logger>
- Save changes on log.config.xml
- Foe <UFT>\bin\log.config.AutomationAgent.xml, repeat steps 1 to 6, THEN save changes.
- For <UFT>\bin\log.config.RemoteAgent.xml, repeat steps 1 to 6, THEN:
1. Set "level value" to DEBUG, under "LogCatRmtAgent" logger:
<logger name="LogCatRmtAgent">
<level value="DEBUG" />
<appender-ref ref="RollingFileAppender" />
</logger>
2. Save
- For <UFT>\bin\qeee.log.config.xml, repeat steps 1 to 5, THEN:
0. Make sure all appender-ref element values are set to "QEEE_RollingFileAppender":
<root>
<level value="DEBUG" />
<appender-ref ref="QEEE_RollingFileAppender" />
</root>
1. Set "level value" to DEBUG, under "HP.QTP.QEEE" logger:
<logger name="HP.QTP.QEEE" >
<level value="DEBUG" />
</logger>
2. Save
0 Comments