External Log File
I would like to save the test execution log to an external file on disk.
Solution
Overwrite the OnAfterTestCompleted method for individual tests in order to perform logic on Test Results. See our KB article on Executing Custom Scripts Before/After your Test Run for more information.
You can generate a custom log file by using the TestResult class. Write code in the code-behind file of your test (outside of a coded step). Here's how the placement looks:
We have code samples for two file types:
Text File
Finally you'll need to Add an Assembly Reference for ArtOfTest.Common.Design. If it is already present, remove it and add it again. Add it from the *Test Studio\Bin* directory:
- C:\Program Files (x86)\Progress\Test Studio\Bin
Excel File
You'll need to add a reference to Microsoft.Office.Interop.Excel.dll. If it isn't already on your machine, ensure you download the version from Microsoft that matches your Office suite.
You'll need to create the Excel file on disk first.
How to find and use Office PIA's without Visual Studio installed
1. Make sure that during the installation of Microsoft Office .NET Programmability Support was selected.
2. Then you will find the interop assemblies in the Windows Global Assembly Cache, specifically the folder: C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\
This is a hidden protected system folder which won't show up in an ordinary hard drive search. If you try to go to "C:\Windows\assembly" Windows recognizes this as a special folder and will show you the full contents of the GAC in a flattened list instead of the individual folders that make up the GAC.