HandleWebDialog

Top  Previous  Next

×V4.1Ø

S

A

W

WS

ü

Syntax - Basic command

HandleWebDialog <Dialog Type> <Button to Press>

       Where:

<Dialog Type> is a literal string or a variable that contains a literal string of value "ALERT", "CONFIRMATION", "DOWNLOAD", "HTMLDIALOG", "LOGON" , "MESSAGEBOX", "OKCANCEL", "PRINT", "REFRESHWARNING", "TEXTPROMPT", "UPLOAD".

 

Description:

There are two types of dialogs that EMUE can encounter when working with web pages.  The first type is generated out of the content of the website.  This type of dialog has underlying HTML and can be controlled by EMUE as if it were a web page.  The second type of dialog is a browser-generated dialog.  This type of dialog does not have underlying HTML and therefore cannot be controlled using regular web scripting commands.  These dialogs are controlled with the HandleWebDialog command.

<Dialog Type> indicates the type of dialog that is to be handled.  The second parameter, <Button to Press>, determines which button on the dialog will be pressed.

If there is no dialog when the HandleWebDialog is run, EMUE will return an error.

When using the Web Script Builder, a dialog helper will identify the type of dialog as well as help to build a HandleWebDialog command.

 

Syntax - Conditional

If HandleWebDialog <Dialog Type> <Button to Press>

       Where:

<Dialog Type> is a literal string or a variable that contains a literal string of value "ALERT", "CONFIRMATION", "DOWNLOAD", "HTMLDIALOG", "LOGON" , "MESSAGEBOX", "OKCANCEL", "PRINT", "REFRESHWARNING", "TEXTPROMPT", "UPLOAD".

To test for the existence of a dialog before trying to handle it, use the If HandleWebDialog format of the command.  This is useful when the appearance of the dialog is not guaranteed.  When combined with an IF statement, HandleWebDialog can be run conditionally if the dialog exists.  If HandleWebDialog can be used with EMUE block If statement or in-line If Statement.  Additionally, if the dialog exists, EMUE will run any code that is provided within a block if statement.

 

Type of Dialog

Available Buttons or Input Expected

Alert

No additional parameter since there is only one button that can be clicked.

Confirmation

OK | Cancel

Download

Destination path, display timeout, and download timeout where destination is where the downloaded file will be saved, display timeout is the maximum amount of time, in milliseconds, EMUE will wait for the dialog to appear, and download timeout is the maximum time, in milliseconds, that EMUE will wait for the file to download. The parameters can be a literal string, integer or variable.

HTMLDIALOG

Dialog Title which indicates the title of the dialog that should be closed.  This field may include wildcards to accommodate portions of titles that may change. The parameter can be a literal string or variable.

Logon

UserName, Password, Timeout where username and passwords are the required credentials and timeout is the maximum amount of time, in milliseconds, EMUE will wait for the dialog to appear. The   parameters can be a literal string, integer or a variable.

MessageBox

Abort | Cancel | Retry | Ignore | Yes | No

OKCancel

OK | Cancel

Print

Print | Cancel

RefreshWarning

Retry | Cancel

TextPrompt

OK | Cancel

Upload

Local or network file path that the user who is signed is able to access. The parameter can be a literal string or variable.

 

NOTE: It is important to note that in order for EMUE to work with these dialogs you must have the SetStartup CloseUnhandledDialogBoxes set to No. If you do not change this to No, then EMUE will automatically close any dialogs that are opened.

 

Soarian SmartUI: No

Chrome: No

 

Samples:

Some of the dialogs are easier to identify than others and some dialogs handlers will work interchangeably.  The following samples may be helpful in determining what kind of dialog you have encountered.

 

Alert:

Alert

 

Alert Sample:

The following example causes EMUE to close the alert dialog.  Since there is only one button, there is no parameter to choose which button to click..

HandleWebDialog "alert"

 

 

Confirmation:

Confirmation

 

Confirmation Sample:

The following example causes EMUE to click OK on an open Confirmation dialog.

HandleWebDialog "confirmation" "OK"

 

 

Download:                                                                        Alternate Download:

Download       alternatedownload

 

Download Sample:

In the following example, a file will be downloaded and saved in the directory specified.  If the dialog does not appear within five seconds, EMUE will time out and if the file takes longer than 15 seconds to download EMUE will time out and result in an error.  After downloading the file, EMUE renames it with a date stamp.

HandleWebDialog "Download" "C:\EMUE\EOBProcessors\InputFiles\Remit.txt" 5000 15000

RenameFile "C:\EMUE\EOBProcessors\InputFiles\Remit.txt" "Remit_#today#.txt"

 

NOTE: There are certain instances where EMUE requires a desktop environment in order to be able to simulate mouse and keyboard input, most notably the Windows download dialog.

Unfortunately, Microsoft does not expose access to those functions outside of a logged-on environment, so if that desktop environment is locked or disconnected, EMUE no longer has access to complete its operations.

The only workaround for this is for the machine in question to be kept unlocked (or to access the same login session from another machine) in order to maintain the session.

 

HTMLDIALOG:

The following example causes EMUE to close the HTML dialog that has opened.

HandleWebDialog "htmldialog" "*Transaction Details*"

 

Logon:

The following example causes EMUE to enter the username, password and click OK in a windows security dialog.

HandleWebDialog "Logon" "UserName" "Password" 5000

 

MessageBox:

OKCancel

 

MessageBox Sample:

The following example causes EMUE to click OK on an open MessageBox dialog.

HandleWebDialog "messagebox" "OK"

 

 

OKCancel:

OKCancel

 

OKCancel Sample:

The following example causes EMUE to click the cancel button on an open OK/Cancel dialog.

HandleWebDialog "okcancel" "Cancel"

 

 

Print:

Print

Print Sample 1:

The following example causes EMUE to click Print on an open Print dialog.

HandleWebDialog "Print" "Print"

 

Print Sample 2:

The next example causes EMUE to click Cancel on an open Print dialog.

HandleWebDialog "Print" "Cancel"

 

Print Sample 3:

The next example checks for the existence of a Print dialog.  If it exists, EMUE will click the Print button and go to the NextPatient label.

If HandleWebDialog "Print" "OK" Then

       Goto NextPatient

EndIf

 

 

RefreshWarning:

Refresh

 

RefreshWarning Sample 1:

The following example causes EMUE to click the resend button on a refresh warning dialog.

HandleWebDialog "refreshwarning" "Retry"

 

RefreshWarning Sample 2:

The following example handles a RefreshWarning if it appears.  Then EMUE closes the browser and starts processing again.  If the dialog does not exist, EMUE will move past the IF statement like it would with any other conditional statement.

If HandleWebDialog "RefreshWarning" "Cancel" Then

       CloseWebPage

       Goto Start

EndIf

 

 

TextPrompt:

TextPrompt

TextPrompt Sample:

The following example causes EMUE to click the cancel button on an open Textprompt dialog.

HandleWebDialog "textprompt" "Cancel"

 

 

Upload:

Upload

 

Upload Sample:

The following example causes EMUE to upload the file specified.

HandleWebDialog "Upload" "M:\Patient Accounting\EMUE\Eligibility\FilesToUpload\MCR.txt"

 

See Also:

Identifying an Element

CloseUnhandledDialogBoxes

SetWebUploadFile