WebTestContext 類別
表示 WebTest 可使用的內文。
繼承階層架構
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 物件加入至 WebTestContext。 |
![]() |
Add(String, Object) | 將具有提供索引鍵和值的元素加入至 WebTestContext。 |
![]() |
Clear | 移除 WebTestContext 中的所有項目。 |
![]() |
Contains | 判斷 WebTestContext 是否包含指定之索引鍵/值組。 |
![]() |
ContainsKey | 判斷 WebTestContext 是否包含具有指定之索引鍵的項目。 |
![]() |
CopyTo | 將 WebTestContext 項目複製到 KeyValuePair 物件陣列中。 |
![]() |
Equals | 判斷指定的物件是否等於目前的物件。 (繼承自 Object)。 |
![]() |
Finalize | 在記憶體回收開始前,允許物件嘗試釋放資源,並執行其他清除作業。 (繼承自 Object)。 |
![]() |
GetEnumerator | 傳回含有 WebTestContext 項目的 IEnumerator。 |
![]() |
GetHashCode | 做為預設雜湊函式。 (繼承自 Object)。 |
![]() |
GetType | 取得目前實例 Type 的屬性。 (繼承自 Object)。 |
![]() |
MemberwiseClone | 建立目前 Object 的淺層複製 (Shallow Copy) 。 (繼承自 Object)。 |
![]() |
Remove(KeyValuePair<String, Object>) | 從 WebTestContext 移除 KeyValuePair。 |
![]() |
Remove(String) | 將有指定索引鍵的元素從 WebTestContext 移除。 |
![]() |
ToString | 傳回代表目前物件的字串。 (繼承自 Object)。 |
![]() |
TryGetValue | 取得與指定索引鍵關聯的值。 |
回頁首
明確介面實作
名稱 | 描述 | |
---|---|---|
![]() ![]() |
IEnumerable.GetEnumerator | 傳回逐一查看 WebTestContext 元素集合的列舉值。 |
回頁首
備註
適用於所有 Web 效能測試,並且包含描述 Web 效能測試內容的資料。 這個資訊包含有關資料繫結值、目前的執行 (如 AgentId 和 ControllerName) 以及其他內容資訊。
這個類別不提供任何公用建構函式。
執行緒安全
這個類型的任何 Public static (在 Visual Basic 中為 Shared) 成員都是安全執行緒。不保證任何執行個體成員是安全執行緒。
請參閱
參考
Microsoft.VisualStudio.TestTools.WebTesting 命名空間