问题
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