0

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."

TTCG
  • 8,805
  • 31
  • 93
  • 141
  • Why are you passing the ".webtest" file to the `/testContainer`? You should be passing it a `.dll`. See https://msdn.microsoft.com/en-us/library/ms182489.aspx . – AdrianHHH Jul 24 '18 at 20:45
  • I did try to pass .dll only but, still no luck. Please see the last line in my question. I'm following the guide here: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/ms243149(v=vs.100) – TTCG Jul 24 '18 at 21:19

0 Answers0