Can a standalone .EXE be created from a coded WebTest in Visual Studio Team Studio

删除回忆录丶 提交于 2020-01-24 09:20:06

问题


I am running VS Team Studio 2008. I have created a web test that I want to use for monitoring a company web site. It interacts with the site and does some round trip processing. I want to create a standalone EXE file that can be run remotely. I have tried converting it to VB code and C# code and then creating compiling it into an EXE. But, when running it, no traffic is generated from the host to the webserver. Has anyone tried to do this before successfully?

I tried this in VB.

  Option Strict Off
  Option Explicit On

  Imports Microsoft.VisualStudio.TestTools.WebTesting
  Imports Microsoft.VisualStudio.TestTools.WebTesting.Rules
  Imports System
  Imports System.Collections.Generic
  Imports System.Text

  Public Module RunMonitor
    Sub Main()
        Dim S As Monitor.MonitorCoded = New Monitor.MonitorCoded()
        S.Run()
    End Sub
  End Module
  Namespace TheMonitor
    Public Class MonitorCoded
        Inherits ThreadedWebTest
        Public Sub New()
            MyBase.New()
            Me.PreAuthenticate = True
        End Sub

   Public Overrides Sub Run()
    'WebRequest code is here'
     End Sub
    End Class
  End Namespace

Any suggestions appreciated.


回答1:


Daniel, I created most of the classes in the Microsoft.VisualStudio.TestTools.WebTesting namespace and I can assure you it's NOT possible to run a coded web test without Visual Studio or MSTest.exe. Coded web tests basically hand WebTestRequests back to the web test engine, they don't start the web test engine themselves.

We weren't trying to prevent the use case you described, but it just wasn't a design goal.

Josh




回答2:


Can you call MSTest.exe? If your test was created using VisualStudio, it uses MSTest to execute it.

If you didn't use VisualStudio to create the webTest, can you provide a little more detail?



来源:https://stackoverflow.com/questions/129932/can-a-standalone-exe-be-created-from-a-coded-webtest-in-visual-studio-team-stud

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!