#UsePageExact

System variable - Web function

The #UsePageExact system variable controls how HTML Web page titles are handled when the script is running. The default value is 0, which means that the script finds a Web page even if it has a slightly different title than the one it had when the script was recorded (fuzzy matching).

Usage

UsePage function includes an automatic synchronization and waits until the page is loaded. But if two Web pages have a title beginning with the same characters and if no ClickHTMLElement line is between the two UsePage lines, you have to force #UseExact=1 if you want WinTask to see it's 2 different pages. Wildcards in page title are supported by truncating the page title.

Syntax

#UsePageExact = 0
or
#UsePageExact = 1

Remarks

If #UsePageExact=0 (default value), at execution of a UsePage function, WinTask looks for a page title which starts with the same characters than those specified in the UsePage function.

If a matching page title is still not found after the fuzzy match, the UsePage fails and the error message "Page not found" is displayed (unless #IgnoreErrors=1)

Examples

'The UsePage replays correctly even if the specified title of the page is not the correct one as the default value for #UsePageExact is 0

StartBrowser("IE", "www.wintask.com")

UsePage("WinTask - silly title")

ClickHTMLElement("A[INNERTEXT= 'How It Works']")

 

'The UsePage does not replay correctly when #UsePageExact is set to 1

StartBrowser("IE", "www.wintask.com")

#UsePageExact=1
UsePage("WinTask - silly title")

ClickHTMLElement("A[INNERTEXT= 'How It Works']")

 

'But this UsePage replays correctly even with #UsePageExact set to 1 as we have truncated the title

StartBrowser("IE", "www.wintask.com")

#UsePageExact=1
UsePage("WinTask")

ClickHTMLElement("A[INNERTEXT= 'How It Works']")

 

UsePage("WinTask - How it works")

ClickHTMLElement("A[INNERTEXT= 'Contact Us']")