Response VerifyTitle Method (String)C# API
Verifies that the title of this Response page matches the specified title.

Namespace: Facilita.Web
Assembly: clrWebBrowser (in clrWebBrowser.dll) Version: 9.5.7.98 (1.0.0.0)
Syntax

public bool VerifyTitle(
	string title
)

Parameters

title
Type: System String
The title that this Response object is expected to contain.

Return Value

true if the title of this Response object matches the specified title; otherwise, false.
Remarks

The title of a Response object is extracted from between the <title></title> tags in the HTML page content. This method is a simple way to check that a Response object returned from Send  or SendTopLevel  methods contains the page that you are expecting it to.

Note Note
If the method returns false, likely causes may include a dropped network connection or an error page returned by the server.

When a script is generated from a trace, calls to VerifyTitle() are inserted after every Send  method call and the page titles from the recorded responses are automatically inserted as parameters.

Examples

The following example demonstrates checking the title of a HTML page response.
Response response = request.Send(); 
if (!response.VerifyTitle("Login successful")) 
{
    // Login failed - we didn't get the page title we expected 
    NextIteration(); 
}
See Also