Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

WebTestContext Class

Represents the context available to a WebTest.


Namespace:  Microsoft.VisualStudio.TestTools.WebTesting
Assembly:  Microsoft.VisualStudio.QualityTools.WebTestFramework (in Microsoft.VisualStudio.QualityTools.WebTestFramework.dll)

public class WebTestContext : IDictionary<string, Object>, 
	ICollection<KeyValuePair<string, Object>>, IEnumerable<KeyValuePair<string, Object>>, 

The WebTestContext type exposes the following members.

Public propertyAgentCountGets the total number of agents used in the current test run.
Public propertyAgentIdGets the zero-based index for the current agent.
Public propertyAgentNameGets the name of the agent computer on which the WebTest is running.
Public propertyControllerNameGets the name of the test controller computer.
Public propertyCookieContainerGets or sets the cookies used by previous requests in the Web performance test.
Public propertyCountGets the number of key/value pair elements in the WebTestContext.
Public propertyIsNewUserGets a value that indicates whether the Web performance test is being run in the context of a new user of the target Web site.
Public propertyIsReadOnlyGets a value that indicates whether the WebTestContext is read-only.
Public propertyItemGets or sets the value associated with the specified key from the WebTestContext object.
Public propertyKeysGets a collection of all the keys in the WebTestContext.
Public propertyLastRequestOutcome
Public propertyLastResponseGets or sets the last WebTestResponse.
Public propertyValidationLevelGets the validation level for the current test run.
Public propertyValuesGets a collection of all the values in the WebTestContext.
Public propertyWebTestIterationGets the iteration number of this Web performance test variation.
Public propertyWebTestUserIdGets a value that uniquely identifies a simulated virtual user when you run the Web performance test in a load test.

Public methodAdd(KeyValuePair<String, Object>)Adds a KeyValuePair<TKey, TValue> object to the WebTestContext.
Public methodAdd(String, Object)Adds an element with the provided key and value to the WebTestContext.
Public methodClearRemoves all the elements from the WebTestContext.
Public methodContainsDetermines whether the WebTestContext contains the specified key/value pair.
Public methodContainsKeyDetermines whether the WebTestContext contains an element with the specified key.
Public methodCopyToCopies the WebTestContext elements to an array of KeyValuePair<TKey, TValue> objects
Public methodEqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns an IEnumerator<T> that contains the WebTestContext elements.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemove(KeyValuePair<String, Object>)Removes a KeyValuePair<TKey, TValue> from the WebTestContext.
Public methodRemove(String)Removes the element with the specified key from the WebTestContext.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodTryGetValueGets the value associated with the specified key.

Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorReturns an enumerator that iterates through a collection of WebTestContext elements.

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

© 2015 Microsoft