可以从 Visual Studio Team Studio 中的编码 WebTest 创建独立的 .EXE
我正在运行 VS Team Studio 2008。我创建了一个 Web 测试,我想用它来监视公司网站。 它与站点交互并进行一些往返处理。 我想创建一个可以远程运行的独立 EXE 文件。 我尝试将其转换为 VB 代码和 C# 代码,然后将其编译为 EXE。 但是,运行时,不会生成从主机到网络服务器的流量。 以前有人尝试过成功做到这一点吗?
我在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
任何建议表示赞赏。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
丹尼尔,
我在 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.
Josh
你能调用MSTest.exe吗? 如果您的测试是使用 VisualStudio 创建的,它将使用 MSTest 来执行它。
如果您没有使用 VisualStudio 创建 webTest,您能提供更多详细信息吗?
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?