WebTestContext Class
Represents the context available to a WebTest.
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.TestTools.WebTesting.WebTestContext
Namespace: Microsoft.VisualStudio.TestTools.WebTesting
Assembly: Microsoft.VisualStudio.QualityTools.WebTestFramework (in Microsoft.VisualStudio.QualityTools.WebTestFramework.dll)
Syntax
'Declaration
<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
The WebTestContext type exposes the following members.
Properties
Name | Description | |
---|---|---|
AgentCount | Gets the total number of agents used in the current test run. | |
AgentId | Gets the zero-based index for the current agent. | |
AgentName | Gets the name of the agent computer on which the WebTest is running. | |
ControllerName | Gets the name of the test controller computer. | |
CookieContainer | Gets or sets the cookies used by previous requests in the Web performance test. | |
Count | Gets the number of key/value pair elements in the WebTestContext. | |
IsNewUser | Gets a value that indicates whether the Web performance test is being run in the context of a new user of the target Web site. | |
IsReadOnly | Gets a value that indicates whether the WebTestContext is read-only. | |
Item | Gets or sets the value associated with the specified key from the WebTestContext object. | |
Keys | Gets a collection of all the keys in the WebTestContext. | |
LastRequestOutcome | ||
LastResponse | Gets or sets the last WebTestResponse. | |
ValidationLevel | Gets the validation level for the current test run. | |
Values | Gets a collection of all the values in the WebTestContext. | |
WebTestIteration | Gets the iteration number of this Web performance test variation. | |
WebTestUserId | Gets a value that uniquely identifies a simulated virtual user when you run the Web performance test in a load test. |
Top
Methods
Name | Description | |
---|---|---|
Add(KeyValuePair<String, Object>) | Adds a KeyValuePair<TKey, TValue> object to the WebTestContext. | |
Add(String, Object) | Adds an element with the provided key and value to the WebTestContext. | |
Clear | Removes all the elements from the WebTestContext. | |
Contains | Determines whether the WebTestContext contains the specified key/value pair. | |
ContainsKey | Determines whether the WebTestContext contains an element with the specified key. | |
CopyTo | Copies the WebTestContext elements to an array of KeyValuePair<TKey, TValue> objects | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetEnumerator | Returns an IEnumerator<T> that contains the WebTestContext elements. | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Remove(KeyValuePair<String, Object>) | Removes a KeyValuePair<TKey, TValue> from the WebTestContext. | |
Remove(String) | Removes the element with the specified key from the WebTestContext. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TryGetValue | Gets the value associated with the specified key. |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
IEnumerable.GetEnumerator | Returns an enumerator that iterates through a collection of WebTestContext elements. |
Top
Remarks
Used for every Web performance test and contains data that describes the context of the Web performance test. This information includes data about data-bound values, information about the current run such as the AgentId and ControllerName, and other contextual information.
This class does not provide any public constructors.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.VisualStudio.TestTools.WebTesting Namespace