可以从Visual Studio Team Studio中的已编码WebTest创建独立的.EXE吗? [英] Can a standalone .EXE be created from a coded WebTest in Visual Studio Team Studio
问题描述
我正在运行VS Team Studio2008.我创建了一个Web测试,该Web测试用于监视公司网站.它与站点交互并进行一些往返处理.我想创建一个可以远程运行的独立EXE文件.我尝试将其转换为VB代码和C#代码,然后将其创建为EXE.但是,在运行它时,不会从主机到Web服务器生成任何流量.有没有人尝试过成功完成此操作?
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?
我在VB中尝试过此操作.
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
任何建议表示赞赏.
推荐答案
Daniel, 我在Microsoft.VisualStudio.TestTools.WebTesting命名空间中创建了大多数类,并且可以向您保证,如果没有Visual Studio或MSTest.exe,就无法运行编码的Web测试.编码的Web测试基本上将WebTestRequests交还给Web测试引擎,它们不会自行启动Web测试引擎.
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.
乔什
这篇关于可以从Visual Studio Team Studio中的已编码WebTest创建独立的.EXE吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!