Simulated typing/clicking not always supported for nearly identical UiElements in the same SAP transaction

Hi there,

I’ve been looking on the Forums searching for people with the same problem I’m currently facing, but so far I have yet to see a post with the exact same situation or a solution that did the trick for me as well. Apologies if I did somehow miss a topic that covers my current roadblock.

I’m currently working on a script that enters data in the MIRO transaction in SAP. The data gets fetched from an XLS file and afterwards the script writes the data in different input fields in the SAP transaction. I’ve tested the entire process a few times successfully with the input mode of the SAP application scope being set to Hardware events.

As I was nearing the point of being fully satisfied with the current build of my script I wanted to make sure I would be able to run it in the background. I read in the documentation for that to be possible the input type of all my “Click” and “Type into” activities needs to be set to Simulated. Hence I changed the input mode of the entire SAP application scope to Simulated and I made sure to adapt for any warnings the script gave me after making the change (I had to remove the “click before typing” in a few of my “Type into” activities as UiPath gave the warning that this is only possible for activities with Hardware events as the designated input mode).

Everything seemed fine but once I pressed Debug file I was met with the error below:

image

At first I thought maybe this specific transaction just doesn’t support simulated input mode, maybe it’s just the way I built the script. However, once I put that specific activity on input mode Hardware events and I kept the rest of the application scope on input mode Simulated, all the other activities accepted simulated typing/clicking and the script ran successfully.

So now I have a script that works for just about 95-99% on simulated input mode, yet there is a single activity that does not want to support it. The part I don’t understand is that this specific activity is in the same transaction as the majority of the other ones I use in the script, it is an input field like all the others and it is executed in the same sequence of activities as the other UiElements. Even the descriptors look very alike, the only difference I can see is the actual ID of the element in the SAP transaction.

I’ll add some screenshots to visualize my case.
Below: 2 UiElements that are almost the same, they both have to type something in a certain field in SAP. Activity 1 gives an error when using Simulated typing, but activity 2 is OK.
I pasted them both in the UiExplorer to see if there were any inherent differences but they’re nearly identical apart from the actual ID of the field.


Because the two descriptors are so similar, I feel like it’s not that specific field that is giving me the error. Am I forgetting something else? I should add that between opening the SAP transaction the XLS file is also invoked as well as a for each activity before it starts typing in the SAP fields. I tried adding a focus activity before the “Type into” activity that returns the error, but that didn’t change the outcome.

I’d appreciate any advice I can get. I’m pretty new to working with Studio so I might just be forgetting something basic, but I can’t seem to figure it out by myself. :slight_smile:

Thanks in advance and kind regards!

1 Like

Hello @HERRYGERS_Wouter,

I’ve looked into the scenario described, and for the element indicated I managed to run it successfully using UIAutomation.Activities v22.4.6:

The only difference I noticed is that for the Empty field before typing activity property I had used Single line instead of Multi line. I ran the same workflow using Multi line and then managed to reproduce your issue:

We will look into it, check the expected behavior and come back with an answer, but for now, please let me know if it works by changing the value to Single line.

As a side note, regarding how “alike” the elements really are, however similar they seem by looking at the selector, if you use the Property Explorer area of the UiExplorer, you will notice that the Reference field is a GuiTextField type while the Invoice one is a GuiCTextField SAP WinGUI control. :grin:

Happy automating!

I think you can disregard the above reply, it seems to be related to the data you are actually entering in this type of control. This calendar select control

expects valid date format values, if you try manually entering a date such as 33/33/9999 SAP will highlight the field and display Invalid date on the status bar. Doing the same with the Type Into activity with Simulate will always throw the error.

When you are not using simulate for this specific control, does the field turn red as well? Also please let me know which version of UiAutomation.Activities you are using.

Thank you,
Stefan

Hi there Stefan, many thanks for getting back to me so swiftly!

I’ve tried doing what you described in the first reply by changing the ‘Empty field before typing’ mode from Multi line to Single Line. Somehow on one of the runs it seemed to have worked, but when I re-tested it to be sure it threw the same error whilst the Empty field setting was set to Single line. So alas, no avail just yet!

image

I did indeed notice the small difference between the two fields, one being a GuiTextField and the other a GuiCTextField in the descriptor. I’m not sure if that is going to be the reason as to why the Invoice Date field is throwing that error, but at this point I wouldn’t know what could be the reason either. :slight_smile:

When I am not using simulate for this specific control, the field does not turn red. When I use ‘Hardware events’ as the input mode the control gets filled with the correct details. I’m not opposed to using ‘Hardware events’ as the designated input type for that control, but it would be the only control in the entire process that requires it. It just didn’t feel entirely right that it just doesn’t work on Simulate.

Perhaps the reason is that my UiAutomation.Activities version is outdated? I’ve checked just a minute ago and I do seem to be a few versions behind yours, mine is currently on 21.10.5.
Is this something I need to frequently update manually or can I enable a certain setting that tries to update to the latest version of activities when available?

image

Many thanks and have a nice weekend! :slight_smile:

Wouter