Web Applications Automation

Setting a value with the standard set method may not work on every website, especially on a website with rich framework (e.g. Bootstrap, Angular …).

This behavior is related to:
  • Javascript events attached to items on the web page

  • surface controls

  • a complex page structure

The following example displays a standard case for a website with rich framework.

  1. When setting a value, the user gets a tooltip list as input in the "Component Search" search bar.

    A new message appears on the page to indicate the kind of search that has been performed and if an unknown value has been set.

  2. The user sets the following simulated set event:

    IRPAComponent.pMain.oSearchBox.set("IRPA");

    The set event does not work for the following reasons:
    • No tooltip is displayed.

    • No new message is displayed.

  3. The user sets the following simulated keystroke sequences:

    IRPAComponent.pMain.activate(); 
    IRPAComponent.pMain.activate(); 
    IRPAComponent.pMain.oSearchBox.setFocus(); 
    ctx.keyStroke("IRPA"); 
As a result, a tooltip and a message are displayed.

This solution can be applied to unlocked screens, however, it does not apply to machines with a locked screen and a disconnected Virtual Desktop Infrastructure. With a locked screen, ctx.keystroke is blocked.

Another way to resolve this behavior is to use events attached to the item:
IRPAComponent.pMain.oSearchBox.set("IRPA"); 
IRPAComponent.pMain.oSearchBox.trigger("input"); 

As a result, the tooltip and the corresponding message are displayed. This solution can be applied to machines with a locked screen and disconnected Virtual Desktop Infrastructures, as long as the session is active.

A more complex web page may require the user to work directly in the browser by using the developer mode to find a solution.

For example, it is possible to simulate a specific mouse event on the page:
application.page.item.scriptItem( "dispatchEvent( new MouseEvent( 'mouseover', {'bubbles': true, 'cancelable': true}))"); 

It is also possible to do it for a keyboard event, for input that only needs a specific key input.