Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LarrysGIT/8b7a96f5cfee7908efb439da9f3d7f2c to your computer and use it in GitHub Desktop.
Save LarrysGIT/8b7a96f5cfee7908efb439da9f3d7f2c to your computer and use it in GitHub Desktop.
visual studio, load test results, LoadTestExporterImporter
# References,
# https://stackoverflow.com/questions/46671790/how-to-export-visual-studio-load-test-results-in-ltrar-format
# http://answers.flyppdevportal.com/MVC/Post/Thread/07f025fb-67ad-4569-b10d-b8913a575a3a
# Import the API
[System.Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.QualityTools.LoadTest.dll") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("LoadTest") | Out-Null
# SQL connectionstring of results store
$ConnectionString = "Server=(localdb)\MSSQLLocalDB;Database=LoadTest2010;Integrated Security=True;"
$temp = New-Object Microsoft.VisualStudio.TestTools.WebStress.LoadTestExporterImporter($ConnectionString)
# 1 means result id, from the following query
# select LoadTestRunid from LoadTestRun
$temp.Export(1, "C:\Temp\1.ltrar")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment