Invoke Workflow fails to get correct UiElement

I have an helper workflow to start and login to SAP. This workflow consists only of 2 activities: SAP Logon and SAP Login:

upload://mWEFtHcy3fvZkojkFcGtmsZOnBw.png

This works as intended and successfully logs into sap.

In the SAP Login Activity I added my Out-Argument called arg_app_sap to the SAP Session Window Output.

If I understand the documentation correctly, I should be able to use this to interact with this UI-Element like this:
upload://ks3MiKU733shDJA12qf5hxMquWt.png

Why do I get this Error:

Call Transaction: Could not find the user-interface (UI) element for this action.

Possible solutions:
 •  Ensure application is opened and the UI element is visible on the screen at execution time
 •  Edit the Target of the UI activity and use Validation to debug the issue.
 •  If needed, re-indicate the element as its properties might have changed
 •  Use "Check state" activity to check the application state before executing the action
 •  Increase the "Delay before" value to allow time to the application to render entirely and become responsive

The argument/variable is filled with the (at least I think so) correct value. It does not matter whether I try to use this UI-Element in another workflow (with “invoce workflow” and in/out arguments) or in the same workflow (out of the sap logon block). If I stay in the SAP Logon block it works, but thats not what I want.

upload://clJhxmWSOUuhZaDvmIup9KZRISj.png
Its not working like this

upload://remuv0OJtDMp11QOSuOy4cj1Isd.png
Its working like this (without the Input UI Element settings as it is inside of the acitivity)

sorry I can’t use more than one image as I am a new user?

these are the pictures I couldn’t add, in the same order as the “upload://” texts in the post

@wehnicde

Wrap the entire SAP Logon + SAP Login inside a “Use Application/Browser”

Do this:

  1. Drag Use Application/Browser
  2. Indicate your SAP Logon Pad window (saplogon.exe)
  3. Place SAP Logon and SAP Login inside it
  4. Now open SAP Login activity →
    5.Input element = the Use Application/Browser element* (it will auto-fill)

After this, the SAP Session Window output argument will NOT be Null anymore.

SAP Session Window output argument is not Null, its this:

UiElement { Activate=true, AlterIfDisabled=true, AppZoomFactor=1, Attributes=string[32] { "AppPath", "PID", "TID", "aaname", "aastate", "app", "cls", "foreground", "hasFocus", "hwnd", "isMDIChild", "position", "relativeVisibility", "role", "sapClient", "sapLanguage", "sapProgram", "sapReadyState", "sapScreen", "sapSession", "sapSysName", "sapSysNumber", "sapSysSessionId", "sapTransaction", "sapUser", "selecteditem", "subsystem", "text", "title", "visibility", "wndExtStyles", "wndStyles" }, ClippingRegion=null, ClippingRegion_Normalized=null, DisplayDpiScaleFactor=1, ImageBase64="iVBOR...

Putting EVERYTHING into Use Application/Browser works, but as I said, thats not what I want.

My goal is to invoke this workflow (start and login into sap), and use the sap ui element in the main workflow, so I can’t just put everything into Use Application/Browser

If I use Check App State and put my SAP Session Window output argument as Input I get true, so it works with this at least

  1. Inside your SAP login workflow
    → return the UI element of the SAP main session window
  2. In the main workflow, do:
Attach Window
    Input → SAPSessionElement  (your output argument)
        Inside → all SAP activities

This creates the required window context without using Use Application/Browser.

3 Likes

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