WebTestContext.Item Property
Gets or sets the value associated with the specified key from the WebTestContext object.
Namespace: Microsoft.VisualStudio.TestTools.WebTesting
Assembly: Microsoft.VisualStudio.QualityTools.WebTestFramework (in Microsoft.VisualStudio.QualityTools.WebTestFramework.dll)
Syntax
'Declaration
Public Default Property Item ( _
key As String _
) As Object
public Object this[
string key
] { get; set; }
public:
virtual property Object^ default[String^ key] {
Object^ get (String^ key) sealed;
void set (String^ key, Object^ value) sealed;
}
abstract Item : Object with get, set
override Item : Object with get, set
JScript does not support indexed properties.
Parameters
- key
Type: System.String
A string that corresponds to a key in the collection.
Property Value
Type: System.Object
A Object that contains the value associated with key.
Implements
IDictionary<TKey, TValue>.Item[TKey]
Exceptions
Exception | Condition |
---|---|
KeyNotFoundException | key not found. |
Remarks
Context defined by environmental variables or a load test will override the item returned by this property. So if a Web performance test is running in a Load Test that contains a context called "myContext", a call to MyWebTestContext.Item("myContext") will return the value for the LoadTestContext.Item("myContext").
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.