This procedure describes how to handle web applications with different possible startup pages or dialog box objects that use the Classic Agent. For example,
In cases such as these, you can use the sLocation data-member from the wMainWindow object as a property. You can create a property and it will look exactly like a data-member and will be called like a data-member. When trying to retrieve information from a property the Get portion of the property is executed. And you can add code to deal with login Web pages here.
Here are the steps of what will happen when DefaultBaseState runs:
You can also handle unexpected and occasional dialog boxes in this way, by changing the sLocation data-member to a property and handling different possibilities through a Get function that is part of the property, or you can re-write the Close method. For expected security or login dialog boxes, you can set the sUsername and sPassword for the wMainWindow object.
Window BrowserChild RealPage const PAGE_URL = http://www.somepage.com property sLocation STRING Get ( ) // actually load the page Browser.SetActive ( ) Browser.Location.SetText (PAGE_URL) Browser.Location.TypeKeys ("<Enter>") // wait for the browser to be "ready" Browser.WaitForReady ( ) // if the Login page has shown up… if Login.Exists ( ) // deal with it Login.UserName.SetText (USERNAME) Login.Password.SetText (PASSWORD) Login.OK.Click ( ) // now wait for the browser to be ready Browser.WaitForReady ( ) //this way DefaultBaseState will not try to load the page again return NULL