Home > Language Reference > System Variables > UsePageExact

#UsePageExact

The #UsePageExact system variable specifies if an exact match or a fuzzy match is used for web pages recognition.

Usage

Used to force an exact recognition of a web page when all the pages of a website start with the same characters.

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 statement. If a matching page title is still not found after the fuzzy match, Error Handling mechanism is then used.

If #UsePageExact=1, WinTask looks for a page with the exact same title as the one specified in the UsePage statement. If the page is not found, Error Handling mechanism is used.

See also

UsePage

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/demos")
UsePage("WinTask Demonstration Pages")
ClickHTMLElement("A[INNERTEXT= 'Same Title Pages']")
UsePage("Page With another title")
WriteHTML("INPUT TEXT[NAME= 'company']", "My Company")
 
'The UsePage does not replay correctly when #UsePageExact is set to 1
StartBrowser("IE", "www.wintask.com/demos")
#UsePageExact=1
UsePage("WinTask Demonstration Pages")
ClickHTMLElement("A[INNERTEXT= 'Same Title Pages']")
UsePage("Page With another title")
WriteHTML("INPUT TEXT[NAME= 'company']", "My Company")
 
 
'But this UsePage replays correctly even with #UsePageExact set to 1 as the tile has been truncated
StartBrowser("IE", "www.wintask.com/demos")
#UsePageExact=1
UsePage("WinTask Demonstration Pages")
ClickHTMLElement("A[INNERTEXT= 'Same Title Pages']")
UsePage("Page")
WriteHTML("INPUT TEXT[NAME= 'company']", "My Company")