Home > Language Reference > Web Functions > Navigate

Navigate

The Navigate function loads the specified url/address.

Usage

Used to go directly to a page instead of using the navigation through menus/hyperlinks. For example, on a web site, you have to capture data for n products. The url of each product is the same except the last part. You can then use a loop with a Navigate which goes directly to the url of each product.

Syntax

ret=Navigate(<url_address> [, <timeout>])

Parameters

<url_address>, string, url to load.

<timeout>, integer, optional, maximum delay in seconds to wait for the url to be loaded before reporting an error. If this optional parameter is not specified, the value of #ActionTimeout is used (default value is 30 seconds).

Return value

Ret, optional numeric return code. If <url_address> can be loaded within the timeout period, the function returns the load time of the url in tenths of a second. If the function fails, the return value is a negative value (see Web Functions Error Codes).

Remarks

Navigate is not generated automatically by Recording mode. Add this function in the script for navigating directly to an url.

If a StartBrowser is done loading a blank page, the automatic synchronization on the page loaded cannot be done, so the Navigate function fails if an absolute Pause (Pause 2 secs for example) is not added between the StartBrowser line and the Navigate line. Under Vista/Windows 7, a StartBrowser with a blank page followed by a Navigate is rejected by the browser if UAC is on. So we recommend to always use a StartBrowser loading an url before using the Navigate function.

Navigate needs a successfull StartBrowser or UsePage before in the script for navigating to the new specified url.

Examples

StartBrowser("IE","www.wintask.com")
UsePage("Macro and Data Extraction with WinTask - the automation software for Windows and internet")
Navigate("http://www.wintask.com/top-10-uses.php")
CloseBrowser()


StartBrowser("FF","www.wintask.com")
UsePage("Macro and Data Extraction with WinTask - the automation software for Windows and internet")
Navigate("http://www.wintask.com/top-10-uses.php")
CloseBrowser()


StartBrowser("CH","www.wintask.com")
UsePage("Macro and Data Extraction with WinTask - the automation software for Windows and internet")
Navigate("http://www.wintask.com/top-10-uses.php")
CloseBrowser()