TTCG
TTCG

Reputation: 9113

How to Run VS2017 WebTest from Command Line?

How can I run MS WebTest from Command Line? I'm getting DLL not found error.

1st Step I copied everything in \Debug folder to special location to run. enter image description here

2nd Step I used VS2017 Command Prompt to run WebTest as described in Tutorials

mstest /testContainer:WebTest1.webtest

enter image description here

Error Result But it keeps saying the error message:

Could not load file or assembly 'WebAndLoadTestProject1

<ErrorInfo>
              <Message>Exception in PreWebTest event: Could not load file or assembly 'WebAndLoadTestProject1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.</Message>
              <StackTrace>   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
       at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
       at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark)
       at System.Type.GetType(String typeName, Boolean throwOnError)
       at Microsoft.VisualStudio.TestTools.WebTesting.WebTestRuleBase.get_Type()
       at Microsoft.VisualStudio.TestTools.WebTesting.WebTestPluginReference.CreateInstance()
       at Microsoft.VisualStudio.TestTools.WebTesting.DeclarativeWebTest.OnPreWebTest(PreWebTestEventArgs e)
       at Microsoft.VisualStudio.TestTools.WebTesting.WebTest.InvokePreWebTest()
       at Microsoft.VisualStudio.TestTools.WebStress.WebTestCaseVariation.Start()</StackTrace>
            </ErrorInfo>

It seems to me that the Tests are not running in the given folder. Looks like, it's running from TestResults/In or TestResults/Out folder where WebAndLoadTestProject.dll does not exist.

I couldn't figure out what I did wrong. Could you please help me to figure out?

PS. If I use mstest /testContainer:WebAndLoadTestProject1.dll, it says "No tests to execute."

Upvotes: 0

Views: 434

Answers (0)

Related Questions