TestContext.RequestedPage Property

 

Gets the requested page.

Namespace:   Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

Syntax

public virtual Page RequestedPage { get; }
public:
property Page^ RequestedPage {
    virtual Page^ get();
}
abstract RequestedPage : Page with get
override RequestedPage : Page with get
Public Overridable ReadOnly Property RequestedPage As Page

Property Value

Type: System.Web.UI.Page

A Page object.

Exceptions

Exception Condition
InvalidCastException

An invalid value type is associated with the RequestedPage property of the test context.

Remarks

This property is only valid when you run ASP.NET unit tests. This property references the Page object created by the URL used to invoke the test.

See Also

TestContext Class
Microsoft.VisualStudio.TestTools.UnitTesting Namespace

b41b6c8b-5c47-4445-a73a-1b095c626c93

Return to top