共用方式為


WebTestContext 類別

表示 WebTest 可使用的內文。

繼承階層架構

System.Object
  Microsoft.VisualStudio.TestTools.WebTesting.WebTestContext

命名空間:  Microsoft.VisualStudio.TestTools.WebTesting
組件:  Microsoft.VisualStudio.QualityTools.WebTestFramework (在 Microsoft.VisualStudio.QualityTools.WebTestFramework.dll 中)

語法

'宣告
<SerializableAttribute> _
Public Class WebTestContext _
    Implements IDictionary(Of String, Object),  _
    ICollection(Of KeyValuePair(Of String, Object)), IEnumerable(Of KeyValuePair(Of String, Object)),  _
    IEnumerable
[SerializableAttribute]
public class WebTestContext : IDictionary<string, Object>, 
    ICollection<KeyValuePair<string, Object>>, IEnumerable<KeyValuePair<string, Object>>, 
    IEnumerable
[SerializableAttribute]
public ref class WebTestContext : IDictionary<String^, Object^>, 
    ICollection<KeyValuePair<String^, Object^>>, IEnumerable<KeyValuePair<String^, Object^>>, 
    IEnumerable
[<SerializableAttribute>]
type WebTestContext =  
    class
        interface IDictionary<string, Object>
        interface ICollection<KeyValuePair<string, Object>>
        interface IEnumerable<KeyValuePair<string, Object>>
        interface IEnumerable
    end
public class WebTestContext implements IDictionary<String, Object>, ICollection<KeyValuePair<String, Object>>, IEnumerable<KeyValuePair<String, Object>>, IEnumerable

WebTestContext 型別會公開下列成員。

屬性

  名稱 說明
公用屬性 AgentCount 取得用於目前測試回合之代理程式的總數。
公用屬性 AgentId 取得目前代理程式的索引 (以零起始)。
公用屬性 AgentName 取得正在執行此 WebTest 的代理程式電腦名稱。
公用屬性 ControllerName 取得測試控制器電腦的名稱。
公用屬性 CookieContainer 取得或設定 Web 效能測試中上一個要求所使用的 Cookie。
公用屬性 Count 取得 WebTestContext 中的索引鍵/值組項目數。
公用屬性 IsNewUser 取得值,指出 Web 效能測試是否在目標 Web 網站的新使用者內容中執行。
公用屬性 IsReadOnly 取得值,指出 WebTestContext 是否為唯讀。
公用屬性 Item 取得或設定與來自 WebTestContext 物件之指定索引鍵關聯的值。
公用屬性 Keys 取得 WebTestContext 中所有索引鍵的集合。
公用屬性 LastRequestOutcome
公用屬性 LastResponse 取得或設定最後一個 WebTestResponse
公用屬性 ValidationLevel 取得目前測試回合的驗證層級。
公用屬性 Values 取得 WebTestContext 中所有值的集合。
公用屬性 WebTestIteration 取得這個 Web 效能測試變化的反覆項目編號。
公用屬性 WebTestUserId 取得值,這個值在執行負載測試中的 Web 效能測試時,可以唯一識別模擬的虛擬使用者。

回頁首

方法

  名稱 說明
公用方法 Add(KeyValuePair<String, Object>) KeyValuePair<TKey, TValue> 物件加入至 WebTestContext。
公用方法 Add(String, Object) 將具有提供索引鍵和值的元素加入至 WebTestContext。
公用方法 Clear 移除 WebTestContext 中的所有項目。
公用方法 Contains 判斷 WebTestContext 是否包含指定之索引鍵/值組。
公用方法 ContainsKey 判斷 WebTestContext 是否包含具有指定之索引鍵的項目。
公用方法 CopyTo 將 WebTestContext 項目複製到 KeyValuePair<TKey, TValue> 物件陣列中。
公用方法 Equals 判斷指定的物件是否等於目前物件。 (繼承自 Object)。
受保護的方法 Finalize 允許物件在記憶體回收進行回收之前,嘗試釋放資源並執行其他清除作業。 (繼承自 Object)。
公用方法 GetEnumerator 傳回含有 WebTestContext 項目的 IEnumerator<T>
公用方法 GetHashCode 做為特定型別的雜湊函式。 (繼承自 Object)。
公用方法 GetType 取得目前執行個體的 Type。 (繼承自 Object)。
受保護的方法 MemberwiseClone 建立目前 Object 的淺層複本 (Shallow Copy)。 (繼承自 Object)。
公用方法 Remove(KeyValuePair<String, Object>) KeyValuePair<TKey, TValue> 從 WebTestContext 中移除。
公用方法 Remove(String) 將有指定索引鍵的元素從 WebTestContext 移除。
公用方法 ToString 傳回表示目前物件的字串。 (繼承自 Object)。
公用方法 TryGetValue 取得與指定索引鍵關聯的值。

回頁首

明確介面實作

  名稱 說明
明確介面實作私用方法 IEnumerable.GetEnumerator 傳回逐一查看 WebTestContext 元素集合的列舉值。

回頁首

備註

適用於所有 Web 效能測試,並且包含描述 Web 效能測試內容的資料。 這個資訊包含有關資料繫結值、目前的執行 (如 AgentIdControllerName) 以及其他內容資訊。

這個類別不提供任何公用建構函式。

執行緒安全

這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。不保證任何執行個體成員是安全執行緒。

請參閱

參考

Microsoft.VisualStudio.TestTools.WebTesting 命名空間

其他資源

Working with Web Tests