Search code examples
visual-studiopluginsmstestperformance-testingload-testing

Is it possible to execute a load test, which uses a web test plugin by using MSTest command line?


I have a web performance test, which uses web test plugin. Based on this web performance test, I created a load test. When I run the load test from the Visual Studio 2013, the load test runs correctly on all my remote agents. However when I run the same test by using MSTest command line, I get an error indicating that the PlugIn (C#) was not loaded. My question is whether it is possible to execute a load test (with plugin) by using the command line MSTest? If yes, then what I need to do to get rid of the error?

Please note that I have already referenced the plugin in my visual studio projects (both web performance project and load test projects)

Thx Here is the error that I get:

Run has the following issue(s):

  Could not run load test 'ABC' on agent 'XYZ': Could not load
  file or assembly 'PlugIn, Version=1.0.0.0, Culture=neutral,PublicKeyToken=null
 ' or one of its dependencies. The system cannot find the file  specified.
  Could not load file or assembly 'PlugIn, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The system cannot find the file specified.

Solution

  • When Visual Studio runs a test from within a solution it understands deployment items, such as DLLs for plugins and it deploys them automatically. By contrast mstest.exe does not do any automatic deployment. Hence you need to deploy the files yourself. That is commonly done via the "deployment" sections of a .testrunconfig or a .testsettings file.

    Having specified the DLLs to be deployed in one of these two file types, add the corresponding /testsettings:{file name} or /runconfig:{file name} options into the call of mstest.exe.

    See, for example, section 3 of this Microsoft blog.