|
1 | 1 | ---
|
2 | 2 | title: "Analyzing Coded UI Tests Using Coded UI Test Logs | Microsoft Docs"
|
3 |
| -ms.custom: "" |
4 | 3 | ms.date: "11/04/2016"
|
5 |
| -ms.reviewer: "" |
6 |
| -ms.suite: "" |
7 | 4 | ms.technology: vs-devops-test
|
8 |
| -ms.tgt_pltfrm: "" |
9 | 5 | ms.topic: "article"
|
10 | 6 | ms.author: gewarren
|
11 | 7 | manager: ghogen
|
12 |
| -ms.workload: |
| 8 | +ms.workload: |
13 | 9 | - "multiple"
|
14 | 10 | author: gewarren
|
15 | 11 | ---
|
16 | 12 | # Analyzing Coded UI Tests Using Coded UI Test Logs
|
17 |
| -Coded UI test logs filter and record important information about your coded UI test runs. |
18 |
| - |
19 |
| - **Requirements** |
20 |
| - |
21 |
| -- Visual Studio Enterprise |
22 |
| - |
23 |
| -## Why should I do this? |
24 |
| - The logs are presented in a format that allows for debugging issues quickly. |
25 |
| - |
26 |
| -## How do I do this? |
27 |
| - |
28 |
| -### Step 1: Enable logging |
29 |
| - Depending on your scenario, use one of the following methods to enable the log. |
30 |
| - |
31 |
| -- Target .NET Framework version 4 with no App.config file present in the test project |
32 |
| - |
33 |
| - - Open the **QTAgent32_40.exe.config** file. |
34 |
| - |
35 |
| - By default, this file is located in **\<drvie>:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE**. |
36 |
| - |
37 |
| - Modify the value for EqtTraceLevel to the log level you want. |
38 |
| - |
39 |
| - Save the file. |
40 |
| - |
41 |
| -- Target .NET Framework version 4.5 with no App.config file present in the test project |
42 |
| - |
43 |
| - - Open the **QTAgent32.exe.config** file. |
44 |
| - |
45 |
| - By default, this file is located in **\<drvie>:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE**. |
46 |
| - |
47 |
| - Modify the value of the EqtTraceLevel to the log level you want. |
48 |
| - |
49 |
| - Save the file. |
50 |
| - |
51 |
| -- App.config file present in the test project |
52 |
| - |
53 |
| - - Open App.config file in the project. |
54 |
| - |
55 |
| - Add the following code under the configuration node: |
56 |
| - |
57 |
| - `<system.diagnostics> <switches> <add name="EqtTraceLevel" value="4" /> </switches> </system.diagnostics>` |
58 |
| - |
59 |
| -- Enable logging from the test code itself |
60 |
| - |
61 |
| - - <xref:Microsoft.VisualStudio.TestTools.UITesting.PlaybackSettings.LoggerOverrideState%2A> = HtmlLoggerState.AllActionSnapshot; |
62 |
| - |
63 |
| -### Step 2: Run your coded UI test and view the log |
64 |
| - When you run a coded UI test with the modifications to the **QTAgent32.exe.config** file in place, you will see there is an output link in the Test Explorer results. Log files are produced not only when your test fails, but also for successful tests when the trace level is set to "verbose." |
65 |
| - |
66 |
| -1. On the **TEST** menu, choose **Windows** and then select **Test Explorer**. |
67 |
| - |
68 |
| -2. On the **BUILD** menu, choose **Build Solution**. |
69 |
| - |
70 |
| -3. In Test Explorer, select the coded UI test you want to run, open its shortcut menu, and then choose **Run Select Tests**. |
71 |
| - |
72 |
| - The automated tests will run and indicate if they passed or failed. |
73 |
| - |
| 13 | + |
| 14 | +Coded UI test logs filter and record important information about your coded UI test runs. |
| 15 | + |
| 16 | + **Requirements** |
| 17 | + |
| 18 | +- Visual Studio Enterprise |
| 19 | + |
| 20 | +## Why should I do this? |
| 21 | + |
| 22 | +The logs are presented in a format that allows for debugging issues quickly. |
| 23 | + |
| 24 | +## How do I do this? |
| 25 | + |
| 26 | +### Step 1: Enable logging |
| 27 | + |
| 28 | +Depending on your scenario, use one of the following methods to enable the log. |
| 29 | + |
| 30 | +- Target .NET Framework version 4 with no App.config file present in the test project |
| 31 | + |
| 32 | + - Open the **QTAgent32_40.exe.config** file. |
| 33 | + |
| 34 | + By default, this file is located in **\<drvie>:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE**. |
| 35 | + |
| 36 | + Modify the value for EqtTraceLevel to the log level you want. |
| 37 | + |
| 38 | + Save the file. |
| 39 | + |
| 40 | +- Target .NET Framework version 4.5 with no App.config file present in the test project |
| 41 | + |
| 42 | + - Open the **QTAgent32.exe.config** file. |
| 43 | + |
| 44 | + By default, this file is located in **\<drvie>:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE**. |
| 45 | + |
| 46 | + Modify the value of the EqtTraceLevel to the log level you want. |
| 47 | + |
| 48 | + Save the file. |
| 49 | + |
| 50 | +- App.config file present in the test project |
| 51 | + |
| 52 | + - Open App.config file in the project. |
| 53 | + |
| 54 | + Add the following code under the configuration node: |
| 55 | + |
| 56 | + `<system.diagnostics> <switches> <add name="EqtTraceLevel" value="4" /> </switches> </system.diagnostics>` |
| 57 | + |
| 58 | +- Enable logging from the test code itself |
| 59 | + |
| 60 | + - <xref:Microsoft.VisualStudio.TestTools.UITesting.PlaybackSettings.LoggerOverrideState%2A> = HtmlLoggerState.AllActionSnapshot; |
| 61 | + |
| 62 | +### Step 2: Run your coded UI test and view the log |
| 63 | + |
| 64 | + When you run a coded UI test with the modifications to the **QTAgent32.exe.config** file in place, you see an output link in the Test Explorer results. Log files are produced not only when your test fails, but also for successful tests when the trace level is set to "verbose." |
| 65 | + |
| 66 | +1. On the **TEST** menu, choose **Windows** and then select **Test Explorer**. |
| 67 | + |
| 68 | +2. On the **BUILD** menu, choose **Build Solution**. |
| 69 | + |
| 70 | +3. In Test Explorer, select the coded UI test you want to run, open its shortcut menu, and then choose **Run Select Tests**. |
| 71 | + |
| 72 | + The automated tests run and indicate if they passed or failed. |
| 73 | + |
74 | 74 | > [!TIP]
|
75 |
| - > To view Test Explorer from the **Test menu**, point to **Windows** and then choose **Test Explorer**. |
76 |
| - |
77 |
| -4. Choose the **Output** link in the Test Explorer results. |
78 |
| - |
79 |
| -  |
80 |
| - |
81 |
| - This displays the output for the test which will include a link to the action log. |
82 |
| - |
83 |
| -  |
84 |
| - |
85 |
| -5. Choose the UITestActionLog.html link. |
86 |
| - |
87 |
| - The log is displayed in your web browser. |
88 |
| - |
89 |
| -  |
90 |
| - |
91 |
| -## Q & A |
92 |
| - |
93 |
| -### Q: What happened to the EnableHtmlLogger key? |
94 |
| - In previous versions of Visual Studio, there were two more configuration settings for enabling Html Logger in Coded UI Test: |
95 |
| - |
96 |
| -``` |
97 |
| - |
98 |
| -<add key="EnableHtmlLogger" value="true"/> |
99 |
| - |
100 |
| -<add key="EnableSnapshotInfo" value="true"/> |
101 |
| - |
102 |
| -``` |
103 |
| - |
104 |
| - Both of these settings have been deprecated since Visual Studio 2012. EqtTraceLevel is the only setting which is required to be modified to enable HtmlLogger. |
105 |
| - |
106 |
| -## See Also |
107 |
| - [Use UI Automation To Test Your Code](../test/use-ui-automation-to-test-your-code.md) |
108 |
| - [How to: Run Tests from Microsoft Visual Studio](http://msdn.microsoft.com/Library/1a1207a9-2a33-4a1e-a1e3-ddf0181b1046) |
| 75 | + > To view Test Explorer from the **Test menu**, point to **Windows** and then choose **Test Explorer**. |
| 76 | +
|
| 77 | +4. Choose the **Output** link in the Test Explorer results. |
| 78 | + |
| 79 | +  |
| 80 | + |
| 81 | + This displays the output for the test, which includes a link to the action log. |
| 82 | + |
| 83 | +  |
| 84 | + |
| 85 | +5. Choose the *UITestActionLog.html* link. |
| 86 | + |
| 87 | + The log is displayed in your web browser. |
| 88 | + |
| 89 | +  |
| 90 | + |
| 91 | +## Q & A |
| 92 | + |
| 93 | +### Q: What happened to the EnableHtmlLogger key? |
| 94 | + |
| 95 | +In previous versions of Visual Studio, there were two more configuration settings for enabling Html Logger in Coded UI Test: |
| 96 | + |
| 97 | +```xml |
| 98 | +<add key="EnableHtmlLogger" value="true"/> |
| 99 | + |
| 100 | +<add key="EnableSnapshotInfo" value="true"/> |
| 101 | +``` |
| 102 | + |
| 103 | +Both of these settings have been deprecated since Visual Studio 2012. EqtTraceLevel is the only setting that is required to be modified to enable HtmlLogger. |
| 104 | + |
| 105 | +## See also |
| 106 | + |
| 107 | +- [Use UI Automation To Test Your Code](../test/use-ui-automation-to-test-your-code.md) |
| 108 | +- [How to: Run Tests from Microsoft Visual Studio](http://msdn.microsoft.com/Library/1a1207a9-2a33-4a1e-a1e3-ddf0181b1046) |
0 commit comments