关闭Web性能测试的自定义错误

时间:2013-11-07 21:26:53

标签: vb.net

我有一个网络测试,我正在尝试关闭CustomErrors,代码如下所示:

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
Imports Test.AppFx.LoadTesting.Platform


Namespace Test.AppFx.LoadTesting.Enterprise

    Public Class Prospect_Init
        Inherits ThreadedWebTest

        Public Sub New()
            MyBase.New()
            Me.PreAuthenticate = True
        End Sub






        Public Overrides Sub Run()
            'Initialize validation rules that apply to all requests in the WebTest
            If (Me.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.Low) Then
                Dim validationRule1 As ValidateResponseUrl = New ValidateResponseUrl()
                AddHandler ValidateResponse, AddressOf validationRule1.Validate
            End If
            If (Me.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.Low) Then
                Dim validationRule2 As ValidationRuleResponseTimeGoal = New ValidationRuleResponseTimeGoal()
                validationRule2.Tolerance = 0.0R
                AddHandler ValidateResponseOnPageComplete, AddressOf validationRule2.Validate
            End If

            ' What ever roles are required for the tests in this scenario should be defined here. All 
            ' tests in the scenario will share them. 

            Dim roles() As String = {"Prospects Area"}

            'Login
            Prospects_Helper.Prospects_Login(Me, roles)

        End Sub

    End Class
End Namespace

所有这些都在给定测试之前运行,并且此特定代码段当前在负载测试期间遇到错误。为了帮助我解决此问题,我需要禁用自定义错误。我发现this并且我知道我需要将模式定义为Off,但我不知道我究竟需要声明什么(因为我在T-SQL中比VB工作更多而且不是熟悉架构)。

有人可以帮我理解我需要添加什么才能在这里关闭自定义错误吗?

0 个答案:

没有答案