How to Identify SAP Error in red at the bottom of the screen?

Hello,

I am trying to capture the error that one gets in red at the bottom of the SAP screen. I am using Element Exist to capture the error and store in a text file. However, the result of Element Exist Activity is always true, even if it is not an error.

Can anyone please help me with this?

Thanks!

1 Like

So the problem here is likely to be that it does technically exist but it just isn’t visible. Couple of things you could do…

  1. Use UiExplorer to see if there are any differences in the properties when it is visible and not visible
  2. Try using find image instead which should return an accurate result - use the clipping region to make the search faster.

RD

1 Like

Hi @oshinkavdia, try using

Element exist to the screen that you are expecting after successful Transaction.

  • If element exist(Screen after Successful transaction) say it as Success

  • Else use Get Text activity and Extract the text from the Bottom Bar in the SAP screen.

HI Guys,

Please check the latest UIAutomation Package for SAP within 2019.12 (Studio, Robot and UIAutomation 2019.12 Preview Release) where we have introduced a new set of SAP WinGUI specific activities. For the case above, you can use Read Statusbar Activity, which will provide you with the right information, it reads the message displayed in the Statusbar on the bottom of the SAP WinGUI window.

Best regards from PM, Lev

2 Likes

Hi buddy,

Element exist usually work well, in that case check the selector of the activity or use image exist activity also.

It should work fine. @oshinkavdia

On the SAP statusbar, I want to check if the message is of type success, warning or error. I am particularly interested in distinguish between an warning message and error message. I am using Studio 2019.10.4 Community Edition.

I tried the following options:

Option1: Using the Get Text of a read statusbar symbol, to check the properties. It is possible to distinguish the success message with PID and TID. However, using the same strategy is not possible to distinguish between the warning and error message as they have the same properties for PID and TID, and all the other properties are equal.

Option2: Update the package UiPath.UIAutomation.Activities = 20.2.0-preview, so that the SAP activities appear under UI Automation, and then use the Read Statusbar activity. The idea is to retrieve the property MessageType S (sucess), W (warning) or E (error). However, it returns the following exception:

RemoteException wrapping UiPath.Core.ElementOperationException: Attribute not supported by the current UiNode. ---> RemoteException wrapping System.Runtime.InteropServices.COMException: Attribute not supported by the current UiNode.

at UiPath.UiNodeClass.Get(String bstrAttr)
at UiPath.Core.UiElement.Get(String attribute, Boolean refresh)

--- End of inner exception stack trace ---

at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Option3: Install with no success the package UiPath.SAP.BAPI.Activities (all versions available in a Community Edition: 2.2.1, 2.2.0, 2.1.0, 2.0.0, 1.2.0, 1.1.0 and 1.0.0). I always get this message:

image

Option4: Use Image Exists and lower the accuracy to 0.7. On my computer, it works fine. However, when I run the workflow in another computer it does not work properly. I know this is an extremely unreliable solution as it depends on the computer configuration as screen resolution, image contrast, etc.

Any help would be so much appreciated :slight_smile:

@Fer

I would highly recommend to use Option 2 - Read Statusbar activity.

The future scenario for you would be like this (this is a screenshot from our Dev Lab Preview):

I am using Read Statusbar Activities (available since 19.12) and Testing activities (this would be released with 20.4).

To use Read Statusbar you have to “Indicate on screen” the whole status bar, then it should work. Try it again. No errors should appears

image

Best regards, Lev

PS:
option 1 - is not good
option 3 - is not suitable at all, BAPI has nothing to do with UI
option 4 - is an extremely unreliable solution

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.