Advanced Logger for UI Test Automation using Azure DevOps

Published Aug 11 2020 10:00 AM 3,738 Views

by  @Edwin Hernandez 

 

In this article, I will describe the implementation of a logger for UI Test automation and the integration with test execution from an Azure DevOps Release pipeline. This article and the demo solution are standalone articles; however, I do build on concepts we reviewed on previous articles, specifically:

 

 

You may want to read through those articles before starting with this one. Having said that, let us get started describing what the logger does.

 

Purpose

UI Test automation and Regression are time-consuming expensive tasks because of their initial time investment and their maintenance effort. Even if a test suite is well maintained, once Automated Regression is executed, you still need a QA Automation Engineer to analyze the results and investigate any errors.

 

The purpose of this logger is to provide a detailed log of the flow of the UI script, including test case steps and screenshots. The QA Engineer or a Business Analyst can use the information from the logger to follow the business logic of the UI test and more easily validate if the intended work was completed or the reason for failure if an error occurred. A descriptive log can be more useful than even an actual video recording of the test.

 

Logger Features

  • The logger creates a single HTML file that contains all messages and embedded images.
  • This class is meant to be used in a Page Object Model project, when the LogMessage method is called it reflects itself to get the calling method and class and it uses this information to write a message into the HTML log.
  • There are 4 log levels to help filtering how much information you want to log (error, warning, passed, info). This and other configurations are exposed as global variables. You can also specify the level up to which you want screenshots to be taken.
  • Screenshots are saved as binary strings and embed into the HTML file so that you end up with a single file. This greatly helps the integration with Azure DevOps.
  • This logger is adaptable since it is a standalone class. You can plug it into several types of UI Test projects. I have personally used it with WinAppDriver, CodedUI, Selenium WebDriver, and Xamarin.UITests projects with minimal changes, pretty much all that needs to be changed is the type of session object that is passed as an argument and the screenshot method.

 

Logger Requirements

  • Given the frameworks I just mentioned, you can guess that this Logger class was written in C# and is meant to be used on Visual Studio for UI Test projects running over MSTest or NUnit projects. You could adapt it to other types of frameworks, but it would require more work.
  • As I said this logger is meant to be used as part of a Page Object Model (POM), it is not that you couldn't use it with a straight Top to Bottom test but you would take more advantage of it in a POM project.

 

Other than that, the log method needs to be specifically called every time something needs to be logged. I explored the option of using the constructor or interfaces, but it would require the class to be more coupled with the test solution and I wanted it to be more portable.

 

Configuration Variables

The logger configuration variables should be put for example on the Class Initialize method:

1.png

 

A log level of 4 would log all messages, a log level of 3 would log only messages level 1 to 3. You can change the labels of the labels in the HTMLLogFile class itself.

 

 

 

 

 

 

Logging Messages from the Test Method

As I mentioned earlier, the LogMessage method needs to be called every time something is to be logged into the file. I recommend that only "Info" level messages should be logged from the Test Method, mostly to log comments and business step details that would make the HTML report easier to read, for example:

3.png

 

 

 

The InsertDividerForNewTest creates a header for the report, then every "Info" step is logged with or without screenshots depending on the configured level.

 

 

Logging Messages from the Page Class Methods

This may be the most interesting part, every time you use LogMessage from the Page Class Methods, the HTMLLogFile class will use reflection to get the calling method/class information and it will include this information into the HTML report, take the following for example:

4.png

 

 

 

By including LogMessage "Passed" at the end, the HTML log will print the following:

Thus, by having well-constructed Page Object Classes, the log would build itself with very few additional comments. 

5.png

 

 

Finding the Log for Local Test Executions

To have this HTML file to be uploaded to Azure DevOps it must be part of the Test Context. This part is included in this demo in the Class Cleanup Method:

6.png

 

 

 

 

If the UI test is executed from Visual Studio (make sure you have WinAppDriver installed, please check my other post about this on the top). The Test Detail Summary should show additional output already part of the Test Context, and inside of that you can see the HTML file:

7.png.

8.png

If you open that, the HTML log should have a header, then every Log Message. Please note that screenshots are expandable on hover.

9.png

 

 

Integration with Azure DevOps Release Pipeline

Now for the next part, I will only show what the result would look like. Setting up a Release Pipeline in Azure DevOps for UI Test Regression is not in the scope of this article. I intend to cover that in a future article, there are several ways to accomplish that depending on what you need to do.

 

For now, the screenshot below is a simple Release Pipeline that takes the Test Assemblies as an artifact, executes the Tests on a Private (Self-Hosted) Build Agent set on interactive mode.

 

MSTest automatically uploads to the Release Pipeline test results information (# of test passed, pass %, duration, etc.) and if you expand a specific test and navigate to the Attachments panel, the HTML Log file should be there already associated with that test. Every test will get a unique HTML file:

10.png

 

 

 

The benefits of running Regression from a Release Pipeline are related to traceability against a Build/Environment and even user stories and test cases. For deployment approval and for historical purposes since tests are saved into the cloud instead of local files.

 

Download Demo Project and HTMLLogFIle class

You can find at the bottom of this post, a file containing a Visual Studio solution that has a demo POM library project, a test project, and the HTMLLogFIle class, as well as a demo HTML report file as a reference.

 

If you have any comments/concerns, please reach out or comment below.

 

%3CLINGO-SUB%20id%3D%22lingo-sub-1579436%22%20slang%3D%22en-US%22%3EAdvanced%20Logger%20for%20UI%20Test%20Automation%20using%20Azure%20DevOps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1579436%22%20slang%3D%22en-US%22%3E%3CP%3Eby%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F130536%22%20target%3D%22_blank%22%3E%40Edwin%20Hernandez%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20article%2C%20I%20will%20describe%20the%20implementation%20of%20a%20logger%20for%20UI%20Test%20automation%20and%20the%20integration%20with%20test%20execution%20from%20an%20Azure%20DevOps%20Release%20pipeline.%20This%20article%20and%20the%20demo%20solution%20are%20standalone%20articles%3B%20however%2C%20I%20do%20build%20on%20concepts%20we%20reviewed%20on%20previous%20articles%2C%20specifically%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Ftestingspot-blog%2Fui-automation-page-object-model-and-other-design-patterns%2Fba-p%2F992242%22%20target%3D%22_blank%22%3EUI%20Automation%20-%20Page%20Object%20Model%20and%20other%20Design%20Patterns%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Ftestingspot-blog%2Fwinappdriver-and-desktop-ui-test-automation%2Fba-p%2F1124543%22%20target%3D%22_blank%22%3EWinAppDriver%20and%20Desktop%20UI%20Test%20Automation%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20may%20want%20to%20read%20through%20those%20articles%20before%20starting%20with%20this%20one.%20Having%20said%20that%2C%20let%20us%20get%20started%20describing%20what%20the%20logger%20does.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1203454610%22%20id%3D%22toc-hId-1203454610%22%3E%3CFONT%20color%3D%22%233366FF%22%3E%3CSTRONG%3EPurpose%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3EUI%20Test%20automation%20and%20Regression%20are%20time-consuming%20expensive%20tasks%20because%20of%20their%20initial%20time%20investment%20and%20their%20maintenance%20effort.%20Even%20if%20a%20test%20suite%20is%20well%20maintained%2C%20once%20Automated%20Regression%20is%20executed%2C%20you%20still%20need%20a%20QA%20Automation%20Engineer%20to%20analyze%20the%20results%20and%20investigate%20any%20errors.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20purpose%20of%20this%20logger%20is%20to%20provide%20a%20detailed%20log%20of%20the%20flow%20of%20the%20UI%20script%2C%20including%20test%20case%20steps%20and%20screenshots.%20The%20QA%20Engineer%20or%20a%20Business%20Analyst%20can%20use%20the%20information%20from%20the%20logger%20to%20follow%20the%20business%20logic%20of%20the%20UI%20test%20and%20more%20easily%20validate%20if%20the%20intended%20work%20was%20completed%20or%20the%20reason%20for%20failure%20if%20an%20error%20occurred.%20A%20descriptive%20log%20can%20be%20more%20useful%20than%20even%20an%20actual%20video%20recording%20of%20the%20test.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--603999853%22%20id%3D%22toc-hId--603999853%22%3E%3CFONT%20color%3D%22%233366FF%22%3E%3CSTRONG%3ELogger%20Features%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3EThe%20logger%20creates%20a%20single%20HTML%20file%20that%20contains%20all%20messages%20and%20embedded%20images.%3C%2FLI%3E%0A%3CLI%3EThis%20class%20is%20meant%20to%20be%20used%20in%20a%20Page%20Object%20Model%20project%2C%20when%20the%20LogMessage%20method%20is%20called%20it%20reflects%20itself%20to%20get%20the%20calling%20method%20and%20class%20and%20it%20uses%20this%20information%20to%20write%20a%20message%20into%20the%20HTML%20log.%3C%2FLI%3E%0A%3CLI%3EThere%20are%204%20log%20levels%20to%20help%20filtering%20how%20much%20information%20you%20want%20to%20log%20(error%2C%20warning%2C%20passed%2C%20info).%20This%20and%20other%20configurations%20are%20exposed%20as%20global%20variables.%20You%20can%20also%20specify%20the%20level%20up%20to%20which%20you%20want%20screenshots%20to%20be%20taken.%3C%2FLI%3E%0A%3CLI%3EScreenshots%20are%20saved%20as%20binary%20strings%20and%20embed%20into%20the%20HTML%20file%20so%20that%20you%20end%20up%20with%20a%20single%20file.%20This%20greatly%20helps%20the%20integration%20with%20Azure%20DevOps.%3C%2FLI%3E%0A%3CLI%3EThis%20logger%20is%20adaptable%20since%20it%20is%20a%20standalone%20class.%20You%20can%20plug%20it%20into%20several%20types%20of%20UI%20Test%20projects.%20I%20have%20personally%20used%20it%20with%20WinAppDriver%2C%20CodedUI%2C%20Selenium%20WebDriver%2C%20and%20Xamarin.UITests%20projects%20with%20minimal%20changes%2C%20pretty%20much%20all%20that%20needs%20to%20be%20changed%20is%20the%20type%20of%20session%20object%20that%20is%20passed%20as%20an%20argument%20and%20the%20screenshot%20method.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1883512980%22%20id%3D%22toc-hId-1883512980%22%3E%3CFONT%20color%3D%22%233366FF%22%3E%3CSTRONG%3ELogger%20Requirements%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3EGiven%20the%20frameworks%20I%20just%20mentioned%2C%20you%20can%20guess%20that%20this%20Logger%20class%20was%20written%20in%20C%23%20and%20is%20meant%20to%20be%20used%20on%20Visual%20Studio%20for%20UI%20Test%20projects%20running%20over%20MSTest%20or%20NUnit%20projects.%20You%20could%20adapt%20it%20to%20other%20types%20of%20frameworks%2C%20but%20it%20would%20require%20more%20work.%3C%2FLI%3E%0A%3CLI%3EAs%20I%20said%20this%20logger%20is%20meant%20to%20be%20used%20as%20part%20of%20a%20Page%20Object%20Model%20(POM)%2C%20it%20is%20not%20that%20you%20couldn't%20use%20it%20with%20a%20straight%20Top%20to%20Bottom%20test%20but%20you%20would%20take%20more%20advantage%20of%20it%20in%20a%20POM%20project.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOther%20than%20that%2C%20the%20log%20method%20needs%20to%20be%20specifically%20called%20every%20time%20something%20needs%20to%20be%20logged.%20I%20explored%20the%20option%20of%20using%20the%20constructor%20or%20interfaces%2C%20but%20it%20would%20require%20the%20class%20to%20be%20more%20coupled%20with%20the%20test%20solution%20and%20I%20wanted%20it%20to%20be%20more%20portable.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-76058517%22%20id%3D%22toc-hId-76058517%22%3E%3CFONT%20color%3D%22%233366FF%22%3E%3CSTRONG%3EConfiguration%20Variables%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3EThe%20logger%20configuration%20variables%20should%20be%20put%20for%20example%20on%20the%20Class%20Initialize%20method%3A%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%221.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211508iE7033D7D9D3F327D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%221.png%22%20alt%3D%221.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20log%20level%20of%204%20would%20log%20all%20messages%2C%20a%20log%20level%20of%203%20would%20log%20only%20messages%20level%201%20to%203.%20You%20can%20change%20the%20labels%20of%20the%20labels%20in%20the%20%3CSTRONG%3EHTMLLogFile%3C%2FSTRONG%3E%20class%20itself.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1731395946%22%20id%3D%22toc-hId--1731395946%22%3E%3CFONT%20color%3D%22%233366FF%22%3E%3CSTRONG%3ELogging%20Messages%20from%20the%20Test%20Method%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3EAs%20I%20mentioned%20earlier%2C%20the%20%3CSTRONG%3ELogMessage%3C%2FSTRONG%3E%20method%20needs%20to%20be%20called%20every%20time%20something%20is%20to%20be%20logged%20into%20the%20file.%20I%20recommend%20that%20only%20%22Info%22%20level%20messages%20should%20be%20logged%20from%20the%20Test%20Method%2C%20mostly%20to%20log%20comments%20and%20business%20step%20details%20that%20would%20make%20the%20HTML%20report%20easier%20to%20read%2C%20for%20example%3A%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211510i17F63C983DBB4333%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%223.png%22%20alt%3D%223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20%3CSTRONG%3EInsertDividerForNewTest%3C%2FSTRONG%3E%20creates%20a%20header%20for%20the%20report%2C%20then%20every%20%22Info%22%20step%20is%20logged%20with%20or%20without%20screenshots%20depending%20on%20the%20configured%20level.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-756116887%22%20id%3D%22toc-hId-756116887%22%3E%3CFONT%20color%3D%22%233366FF%22%3E%3CSTRONG%3ELogging%20Messages%20from%20the%20Page%20Class%20Methods%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3EThis%20may%20be%20the%20most%20interesting%20part%2C%20every%20time%20you%20use%20%3CSTRONG%3ELogMessage%3C%2FSTRONG%3E%20from%20the%20Page%20Class%20Methods%2C%20the%20%3CSTRONG%3EHTMLLogFile%3C%2FSTRONG%3E%20class%20will%20use%20reflection%20to%20get%20the%20calling%20method%2Fclass%20information%20and%20it%20will%20include%20this%20information%20into%20the%20HTML%20report%2C%20take%20the%20following%20for%20example%3A%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%224.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211513i9ACE27B27EC18267%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%224.png%22%20alt%3D%224.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBy%20including%20%3CSTRONG%3ELogMessage%3C%2FSTRONG%3E%20%22Passed%22%20at%20the%20end%2C%20the%20HTML%20log%20will%20print%20the%20following%3A%3C%2FP%3E%0A%3CP%3EThus%2C%20by%20having%20well-constructed%20Page%20Object%20Classes%2C%20the%20log%20would%20build%20itself%20with%20very%20few%20additional%20comments.%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%225.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211514iD46C3F827FE5D783%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%225.png%22%20alt%3D%225.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1051337576%22%20id%3D%22toc-hId--1051337576%22%3E%3CFONT%20color%3D%22%233366FF%22%3E%3CSTRONG%3EFinding%20the%20Log%20for%20Local%20Test%20Executions%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3ETo%20have%20this%20HTML%20file%20to%20be%20uploaded%20to%20Azure%20DevOps%20it%20must%20be%20part%20of%20the%20Test%20Context.%20This%20part%20is%20included%20in%20this%20demo%20in%20the%20Class%20Cleanup%20Method%3A%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2060px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%226.png%22%20style%3D%22width%3A%20513px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211518iF836D2FD71E0A1D8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%226.png%22%20alt%3D%226.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20the%20UI%20test%20is%20executed%20from%20Visual%20Studio%20(make%20sure%20you%20have%20WinAppDriver%20installed%2C%20please%20check%20my%20other%20post%20about%20this%20on%20the%20top).%20The%20Test%20Detail%20Summary%20should%20show%20additional%20output%20already%20part%20of%20the%20Test%20Context%2C%20and%20inside%20of%20that%20you%20can%20see%20the%20HTML%20file%3A%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%227.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211520iC9CCF118C0EECD0B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%227.png%22%20alt%3D%227.png%22%20%2F%3E%3C%2FSPAN%3E.%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%228.png%22%20style%3D%22width%3A%20722px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211524i279690D9CFA8F76C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%228.png%22%20alt%3D%228.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIf%20you%20open%20that%2C%20the%20HTML%20log%20should%20have%20a%20header%2C%20then%20every%20Log%20Message.%20Please%20note%20that%20screenshots%20are%20%3CU%3Eexpandable%20on%20hover.%3C%2FU%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%229.png%22%20style%3D%22width%3A%20620px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211713i7E9054EAC98A081D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%229.png%22%20alt%3D%229.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1436175257%22%20id%3D%22toc-hId-1436175257%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--371279206%22%20id%3D%22toc-hId--371279206%22%3E%3CFONT%20color%3D%22%233366FF%22%3E%3CSTRONG%3EIntegration%20with%20Azure%20DevOps%20Release%20Pipeline%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3ENow%20for%20the%20next%20part%2C%20I%20will%20only%20show%20what%20the%20result%20would%20look%20like.%20Setting%20up%20a%20Release%20Pipeline%20in%20Azure%20DevOps%20for%20UI%20Test%20Regression%20%3CU%3Eis%20not%20in%20the%20scope%3C%2FU%3E%20of%20this%20article.%20I%20intend%20to%20cover%20that%20in%20a%20future%20article%2C%20there%20are%20several%20ways%20to%20accomplish%20that%20depending%20on%20what%20you%20need%20to%20do.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20now%2C%20the%20screenshot%20below%20is%20a%20simple%20Release%20Pipeline%20that%20takes%20the%20Test%20Assemblies%20as%20an%20artifact%2C%20executes%20the%20Tests%20on%20a%20Private%20(Self-Hosted)%20Build%20Agent%20set%20on%20interactive%20mode.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMSTest%20automatically%20uploads%20to%20the%20Release%20Pipeline%20test%20results%20information%20(%23%20of%20test%20passed%2C%20pass%20%25%2C%20duration%2C%20etc.)%20and%20if%20you%20expand%20a%20specific%20test%20and%20navigate%20to%20the%20%3CU%3EAttachments%20panel%3C%2FU%3E%2C%20the%20HTML%20Log%20file%20should%20be%20there%20already%20associated%20with%20that%20test.%20Every%20test%20will%20get%20a%20unique%20HTML%20file%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%2210.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211523iE94964E647E220BD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2210.png%22%20alt%3D%2210.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20benefits%20of%20running%20Regression%20from%20a%20Release%20Pipeline%20are%20related%20to%20traceability%20against%20a%20Build%2FEnvironment%20and%20even%20user%20stories%20and%20test%20cases.%20For%20deployment%20approval%20and%20for%20historical%20purposes%20since%20tests%20are%20saved%20into%20the%20cloud%20instead%20of%20local%20files.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-2116233627%22%20id%3D%22toc-hId-2116233627%22%3E%3CFONT%20color%3D%22%233366FF%22%3E%3CSTRONG%3EDownload%20Demo%20Project%20and%20HTMLLogFIle%20class%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FH3%3E%0A%3CP%3EYou%20can%20find%20at%20the%20bottom%20of%20this%20post%2C%20a%20file%20containing%20a%20Visual%20Studio%20solution%20that%20has%20a%20demo%20POM%20library%20project%2C%20a%20test%20project%2C%20and%20the%20%3CSTRONG%3EHTMLLogFIle%3C%2FSTRONG%3E%20class%2C%20as%20well%20as%20a%20demo%20HTML%20report%20file%20as%20a%20reference.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20have%20any%20comments%2Fconcerns%2C%20please%20reach%20out%20or%20comment%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1579436%22%20slang%3D%22en-US%22%3E%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3EHow%20to%20implement%20an%20advanced%20logger%20for%20UI%20Test%20automation%20with%20WinAppDriver%20and%20integration%20with%20Azure%20DevOps%20Release%20pipelines.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%2210.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211523iE94964E647E220BD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2210.png%22%20alt%3D%2210.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1579436%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EQA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EQuality%20Assurance%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESelenium%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETest%20Automation%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETesting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EUI%20Testing%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EVisual%20Studio%20Test%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Feb 11 2021 11:26 AM