program SendingKeysToPopupWindow; // This sample script processes a popup login window that is not // part of the web page. This is done by identifying the popup window // using it's title, filling in the username, sending the Tab key // to move to the next field, filling in the password and lastly // sending the Enter key to submit. // This script will log into the Newbie Customer page. You MUST // specify the password below. It is blank in this script. New APIs // functions will work with Newbie ver2.2l or later. procedure OnDocumentComplete(URL : string); begin if URL = 'http://www.newbielabs.com/customer/' then begin ClickHyperlink('Pascal Help/'); end; end; begin Navigate('http://www.newbielabs.com/customer'); SendStringToWindow('Connect to www.newbielabs.com', 'customer', 1000); SendKeyPressToWindow('Connect to www.newbielabs.com','Tab', 1000); SendStringToWindow('Connect to www.newbielabs.com', '', 1000); SendKeyPressToWindow('Connect to www.newbielabs.com', 'Enter', 1000); // code below is needed if script is executed in IE browser if IsExecuteScriptIE then begin // wait for login to finish Sleep(4000); // get IE window reference GetActiveBrowserWindow; // trigger OnDocumentcomplete, not needed if no further processing will occur GotoURL('http://www.newbielabs.com/customer'); end; end.