ConfigureWebCommand

Top  Previous  Next

×V4.2Ø

S

A

W

WS

ü

Syntax -

ConfigureWebCommand  <Command Name> <Event> <Firing Option>

       Where:

<Command Name> is one of the following: TypeWebValue, SetWebDropDown, SendEnterToWebElement, SendKeyToWebElement. ClickWebElement

<Event> is one of the following:  Default, OnFocus, OnChange, OnKeyDown, OnKeyPress, OnKeyUp, OnBlur, FireWithMouseEvents, FireWithoutMouseEvents.

<Firing Option> is one of the following:  FireWithWait, FireNoWait, DoNotFire.

Description:

This command is used to configure which events are fired for a particular web command and how they are fired.  An event is what makes a web page interactive  When a button is clicked, for example, behind the scenes, an event is fired that tells the webpage how to respond - display results, go to a new page, open a search window, etc.  

The <Event> parameter specifies which event is being configured.   The <Firing Option> parameter configures whether or not the event should fire and if EMUE should wait for it to complete before continuing.   If an event is not configured, then it will fire and EMUE will wait for the event to finish before continuing.

The normal operation of the TypeWebValue command is to send one character at a time to the web element and for each character, a series of events are also fired.  When sending a single character, the following events are fired on the element:  onFocus, onKeyDown, onKeyPress, onKeyUp, onChange, and onBlur.  This event list provides the maximum assurance that the element will recognize the character as being "typed."  In addition to firing each of these events, they are also fired with the FireWithWait option, which means that EMUE will wait for each event to finish before moving on to the next command.  This creates two potential problems:

1.If any one of the events does not complete, EMUE will appear to be hung while it waits for the event to complete.  For instance, if a dialog is launched on the OnBlur event of a text field, until the dialog is closed, EMUE will not be able to continue because the dialog is blocking communication with the original web page.  In this case, it would be best to send characters to the element and not fire the OnBlur event.  Only when the command is finished should it fire the OnBlur event.  The following command would accomplish this:

       ConfigureWebCommand TypeWebValue OnBlur DoNotFire

2.The second scenario looks like each character takes a long time to enter.  Since by default, each event is fired and then EMUE waits for it to complete (FireWithWait), if the website or connection is slow, then entering text creates a bottle neck.  One resolution to this is to send each character without waiting for events to complete.  Another option is to turn off events.  ConfigureWebCommand should be used once for each event that is configured. The following commands turn off the OnKeyDown event and instruct OnFocus to fire without waiting.

       ConfigureWebCommand TypeWebValue OnKeyDown DoNotFire

       ConfigureWebCommand TypeWebValue OnFocus FireNoWait

There are also situations where the same behaviors affect other commands such as SetWebDropDown, SendEnterToWebElement or SendKeyToWebElement. For example, if you are sending a key stroke to a web element it might also generate a pop up dialog that could cause EMUE to appear to be hung. Again, this is because EMUE is waiting for the events to complete before it continues. In those cases, you have the ability to fire the events without waiting much like the examples above with TypeWebValue that will return control to EMUE so your script can continue.

The two options, FireWithMouseEvents and FireWithoutMouseEvents, are only available on the ClickWebElement command. FireWithoutMouseEvents is the default value. Some buttons require additional events to successfully click on the button.

 

Soarian SmartUI: No

Chrome: No

 

Sample 1:

       The following statement causes EMUE to fire all events on the TypeWebValue command, but prevents EMUE from waiting for the event to complete.  This could also be accomplished using the SETSTARTUP command WebTypingOptimization with the FireEventsWithNoWait option.

ConfigureWebCommand TypeWebValue Default FireNoWait

 

Sample 2:

       The following statement tells EMUE not to wait for the OnBlur event to complete when executing a SetWebDropDown command. Other events associated with a SetWebDropDown command are unaffected by this configuration.

ConfigureWebCommand SetWebDropDown OnBlur FireNoWait

 

Sample 3:

       The following statement causes EMUE to fire all events on the SendEnterToWebElement command, but prevents EMUE from waiting for the events to complete.

ConfigureWebCommand SendEnterToWebElement Default FireNoWait

 

Sample 4:

       The following statement causes EMUE to fire all mouse events on the ClickWebElement command.

ConfigureWebCommand ClickWebElement FireWithMouseEvents FireNoWait

 

Sample 5:

       The following statement causes EMUE to fire an OnFocus mouse event on the ClickWebElement command.

ConfigureWebCommand ClickWebElement OnFocus FireWithWait

 

See Also:

Identifying an Element

SendKeyToWebElement

SendEnterToWebElement

SetWebDropDown

TypeWebValue

ClickWebElement

WebTypingOptimization