1

我有一个网络测试,我试图关闭 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

所有这些都在给定测试之前运行,并且这段特定的代码当前在负载测试期间遇到错误。为了帮助我解决此问题,我需要禁用自定义错误。我找到了这个,我知道我需要将模式定义为关闭,但我不知道我需要声明什么(因为此时我在 T-SQL 中的工作比在 VB 中更多,并且不熟悉建筑学)。

有人可以帮助我了解我需要添加什么来关闭自定义错误吗?

4

0 回答 0