How to export visual studio load test results in .ltrar format?

656 Views Asked by At

I have end to end automation of my performance test execution. But maintenance is bit tricky? I want to export the results in .ltrar format. Does anyone know if there is any automated ways to do that ?

1

There are 1 best solutions below

4
On

Yes, Finally I got the answer to this problem.

Reference below DLL from this location(for vsts2015).

Location: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies" DLL: Microsoft.VisualStudio.QualityTools.LoadTest.dll

Create below Method:
using Microsoft.VisualStudio.TestTools.WebStress;

public static void exportPerformanceResults(int loadtestRunID,string destinationFilePath)
    {   // connection string to the loadtest2010 database (database where the results are being stored) 
        ConnectionStringSettingsCollection settings = ConfigurationManager.ConnectionStrings;
        var importerExporter = new LoadTestExporterImporter(settings["LoadTestDB"].ConnectionString);'

        // exporting results to defined location
        importerExporter.Export(new List<int> { loadtestRunID }, destinationFilePath);
    }`   

Parameters:
LoadTestRunID : ID of the load test which can be found in LoadTestRun table
destinationFilePath: Location where results should be stored

I created an Independent Console Application to Import and Export the performance test results. The application to export the results is triggered once my load test execution is completed. (FYI, All my test runs are executed through command line using mstest.exe)

It gets tricky if you have visual studio 2013. Here is the link to my Blogpost with solution. https://heavenlalpuriya.wordpress.com/2018/01/03/how-to-use-microsoft-visual-studio-2015-dlls-for-visual-studio-2013/