HttpClient Members

HttpClient overview

Public Static Fields

DefaultThe HttpClient that's used by default in all tests.If you're creating a custom tester, don't use this property! Use ControlTester.Browser instead.
FIREFOX_USER_AGENT A User Agent string provided by Firefox 1.0. Use this with UserAgent when you want NUnitAsp to see what Firefox sees.
IE_USER_AGENT A user agent string provided by Internet Explorer 6.0. Use this with UserAgent when you want NUnitAsp to see what IE sees.

Public Instance Constructors

HttpClient ConstructorInitializes a new instance of the HttpClient class.

Public Instance Fields

Credentials Username and password (null if none). Set automatically if the username and password are supplied in the URL (i.e., "http://username:password@host"). Can be used with both "basic" and "Windows Integrated" (NTLM) authentication methods. Set this property to CredentialCache.DefaultCredentials to use your current Windows login.
Proxy The proxy server information to use to proxy HTTP requests. If this property is set to null, the default value returned by GlobalProxySelection.Select is used.
UrlReferrer URL containing the hyperlink or form that caused the browser to load the current url (null if none). Fragments aren't included (the part of the URL that comes after a '#').
UserAgentThe user-agent string to send to the server. Useful if you want to pretend to be a specific browser. Defaults to IE_USER_AGENT.Be careful when changing this, as ASP.NET renders controls differently for different user agents. NUnitAsp's testers may not be able to recognize a control that was rendered for a different browser.
UserLanguages The language-tag elements to send to the server (null if none). These appear in the Request.UserLanguages array in the target page.

Public Instance Properties

Cookies The cookies sent to the server. These are usually set by the server but your test can add cookies to the container and they'll be sent too.
CurrentPageText The raw contents of the current page.
CurrentUrl URL the browser most recently retrieved (null if none). Fragments aren't included (the part of the URL that comes after a '#').
ElapsedServerTime The total time this object has spent waiting for web servers to respond.

Public Instance Methods

CookieValue Returns the value of a cookie. Throws exception if the cookie hasn't been set.
Equals (inherited from Object)
FollowLink Retrieves a page from a web server. Different from GetPage in that it sets the current page as the referrer. You should use normally use GetPage.
GetHashCode (inherited from Object)
GetPage Retrieves a page from a web server.
GetType (inherited from Object)
HasCookie Checks to see if a cookie has been set.
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace