Skip to Content
0
Feb 28, 2020 at 09:47 AM

SAP iRPA Automation of Fiori/SAPUI5 App: simulating keydown events and change events not firing

331 Views Last edit Mar 31, 2020 at 01:33 PM 2 rev

Hello,

i am trying to automate a SAPUI5 Application and am experiencing the following Problems:

I want to set a Value to a Input Field (with suggestions) and let the change event handle the logic. The App depends very much on having the change events of input fields fired, so that validation can be performed directly.

My Problem now is, that no matter what i try, the change event will not get fired.

I tried:

  • setting the value via ctx.item.keyStroke on Field
  • set it via ctx.item.set
  • set it via ctx.apiui5.setValue

Erasing the old value and setting the new one works, just like a change of the value property in DOM Tree, but there seem to be no recognition of an actual input from the sapui5 view, even with keyStroke.

All 3 of them do not fire the change event.

First i tried to use keystroke (to press e.key.Enter after setting the value), but on page Level (or even Core Level: ctx.keystroke) the method does not work.

I tried setting the focus (ctx.item.setFocus()) and clicking out of the field with anotherField.clickMouse() (since SAPUI5 Documentation states, that a changed Value and a Focus leaving the field triggers a change event, too, that seemed to be a workaround)

Furthermore, i tried using the ctx.apiui5.suggestionSearch Method of the Framework, but it gives me "SAPUI5SuggestionSearch is undefined". Trying to initialize the ctx.item in the code as the customType ctx.customTypes.SAPUI5.SF.suggestionSearchField did not work, too.

The last thing i tried is using the generic callFunc Method:

ctx.apiui5.callFunc(myInput,"fireChange");

It does not throw an exception or error, but the change event is not fired though.

I checked in console, that if i call the fireChange function on my Input, it works perfectly fine. Even though a workaround for this would help me, it seems a little bit odd to me, that none of the change events are fired with the common method of setting values/simulating keystrokes.

Can you please elaborate on how the normal events are fired?

PS.: It would be great, if someone could provide information on when an update of this section in the API Documentation will happen, since this section seems very new, it lacks a bit of useful information

Thanks for your effort.
Best regards
Pascal