Page Timeout Error Message

Web automation scripts that use the StartBrowser function to start Internet Explorer may suffer a Page Timeout error if a security or other pop-up window protects the target web page. The error occurs when the StartBrowser function is unable to complete within the default timeout period of 30 seconds as specified by the #ActionTimeout system variable.

The root cause of the error is that the StartBrowser function executes an automatic synchronization that waits for the target web page to completely load. However, the pop-up window must be dismissed before the target web page can be loaded. This leads to a cyclic dependency where the script cannot dismiss the pop-up window until the StartBrowser function completes, but the function cannot complete until the pop-up window is dismissed.

The solution to this problem is to avoid the web page synchronization of the StartBrowser function by using the Shell function. The Shell function waits for Internet Explorer to load, but is not dependent upon the web page to load before it returns. Additional script statements can then be used to process the security or pop-up window.

The techniques in the following script can be adapted for your specific application.

 

' Define the Internet Explorer executable and web page as

' string variables.

ie_exe$="C:\Program Files\Internet Explorer\iexplore.exe"

url$="http://my_site.com"

 

' If a Logon window is displayed before the web page opens,

' define the Userid and Password as string variables.

user_id$="taskware"

passwd$="wintask"

 

' This statement times out if a Security or pop-up window is displayed.

'Startbrowser("IE", url$)

 

' Use the Shell statement to start Internet Explorer specifying the

' web page as the command line argument.

Shell(chr$(34)+ie_exe$+chr$(34)+" "+url$)

 

' The following code clicks the Yes button on a Security Alert window

' to close it.

UseWindow("IEXPLORE.EXE|#32770|Security Alert", 1)

Click(Button, "&Yes")

 

' The following code enters a User ID and Password into a logon web page

' and submits them for verification. The page is closed if verified.

UsePage("My Logon Page")

WriteHTML("INPUT TEXT[NAME= 'my_id']", user_id$)

WriteHTML("INPUT PASSWORD[NAME= 'password']", passwd$)

ClickHTMLElement("A[HREF= 'javascript:CheckIdentity']")

Recording mode should be used to generate the blocks of code needed to dismiss the security or pop-up window specific to your application. See help topic Adding Functionality to Existing Scripts for tips on how to generate the code.