One of the main problems for any test engineer working with a test automation tool is how to resolve the situation when the tool doesn’t work properly. A distinction between an average and good test tool is the way of handling these situations. The minimum that one “good tool” must provide is a log with information of what happened in that test run in order to reduce engineering time necessary to fix that problem or find a workaround. However, this information is in the same time very sensitive, because it might contain an answer to a question if the tool has support for certain platforms.
CodedUITest in Visual Studio 2010 is well equipped with the Debug Trace, containing detailed information about time spent, action performed, control found and even expected time to complete a specific action. This log also contains technology used by Visual Studio to find control, so an average user can try to find out what the cause of the issue is. In a lot of situations, a set of such information will give a user an adequate reason for test failure.
W, 10220, 13, 2010/06/30, 08:28:33.358, 281524579375, QTAgent32.exe, PERF WARNING: FindAllDescendents: took 838 ms. Expected it to take maximum 500 ms.
W, 10220, 13, 2010/06/30, 08:28:35.085, 281529640405, QTAgent32.exe, Playback – {1} [SUCCESS] MouseButtonClick – “[UIA]ControlType=’Button’ && AutomationId=’btnCreateProject’”
W, 10220, 13, 2010/06/30, 08:28:35.663, 281531333898, QTAgent32.exe, Playback – {2} [SUCCESS] MouseButtonClick – “[UIA]ControlType=’Button’ && AutomationId=’NextButton’”
However, the user can enable more detail tracing in two ways
- The first one is by enabling trace for all Testing Tools in VS is to modify the following registry file:
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\EnterpriseTools\QualityTools\Diagnostics]
“EnableTracing”=dword:00000001
“TraceLevel”=dword:00000003
EnableTracing key defines whether tracing is ON or OFF.
o 1 – ON
o 0 – OFF
- The other way is to set EqtTraceLevel or UITestTraceLevel switch in the appropriate exe.config file. The EqtTraceLevel will enable tracing for all Testing Tools modules of the executable. UITestTraceLevel will enable the tracing for only the UI Test modules of the executables.
For UI Test, the trace file is generated in %temp%\UITestLogs\*\LastRun\UITestLog.html where * could be empty for VS or could be exe name like CodedUITestBuilder for other cases. The LastRun here indicates that this is THE file for last run – the earlier ones would be stored as PreviousRunXX. The tool automatically cleans up the old trace file if it exceeds ‘n’ (today it is 25) previous runs.
This log is very useful for an experienced user as it contains full Microsoft Visual Studio log with API calls, the result of API calls and other algorithms used.
Obviously, it doesn’t mean that the user will be able to resolve all situations, but this log will increase productivity of automated software testers by giving them deep information about how the tool works, it will give them an idea how to resolve an issue or how to find workarounds. And if the log shows that the selected UI Technology is not supported, users can extend platform as this framework has been created with idea to overcome situations where this engine will not meet the needs and these means to test applications built on a different or new UI technology.