Share via


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 : 
        key:string -> Object with get, set 
override Item : 
        key:string -> Object with get, set
JScript does not support indexed properties.

Parameters

  • key
    Type: String

    A string that corresponds to a key in the collection.

Property Value

Type: Object
A Object that contains the value associated with key.

Implements

IDictionary.Item

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

See Also

Reference

WebTestContext Class

Microsoft.VisualStudio.TestTools.WebTesting Namespace