Response VerifyTitle Method (String, ActionType)C# API
Verifies that the title of this Response page matches the specified title, and takes the specified action if it does not.

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

public bool VerifyTitle(
	string title,
	ActionType action
)

Parameters

title
Type: System String
The title that this Response object is expected to contain.
action
Type: Facilita.Fc.Runtime ActionType
The action to take if the expected title is not found.

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, moving to the next iteration if the title isn't what's expected.
Response response = request.Send(); 
// Check the title, and move to the next iteration if we detect that the login was unsuccessful
response.VerifyTitle("Login successful", ActionType.ACT_NEXT_ITERATION);
See Also