Veer
Veer

Reputation: 11

SAP GUI automation using Blueprism. The text box id is getting changed frequently. So not able to spy the text box

I am trying to automate one of the SAP GUI screen using Blueprism. The Id of the text box is getting changed frequently. So not able to spy the text box.

I have spied the elements using SAP mode. As the ID’s are getting changed dynamically (approximately 6 hours) for the text boxes, Blue Prism is not able to identify the elements and the process is getting failed.

ID is: session.findById("wnd[0]/usr/subSUB_MAIN:/COCKPIT/SAPLDISPLAY46:0385/subSUB_HDR:/COCKPIT/SAPLDISPLAY46:0405/tabsG_STRIP_HDR/tabpTAB5/ssubSUB:/COCKPIT/SAPLDISPLAY46:0436/ssubSUB_OTHERS:%_T000KW:0200/ctxt/COCKPIT/SHDR_DISP-RPA").text = "".

Here the value T000KW will be changing frequently. Can any one please help me how to handle this issue?

Upvotes: 1

Views: 1902

Answers (2)

Andrzej Kaczor
Andrzej Kaczor

Reputation: 1557

I'd probably try to use a different spying mode in that situation. Have you tried using it here?

The other solution would be to use SAP API with code stages as Bálint Erdősi suggests.

Upvotes: 1

berdosi
berdosi

Reputation: 79

tl;dr: You should probably get the changing GuiComponent's ID, and use it. In the worst case, you can detect the GuiComponent's parent and list its children's IDs.

There are several approaches, some of them might eventually work:

  1. When spying in Application Modeller, the matching mode of the properties are by default set to be Equal. Sometimes loosening the matching condition helps.

    1. Try matching by wildcards, as such wnd[0]/usr/subSUB_MAIN:/COCKPIT/SAPLDISPLAY46:0385/subSUB_HDR:/COCKPIT/SAPLDISPLAY46:0405/tabsG_STRIP_HDR/tabpTAB5/ssubSUB:/COCKPIT/SAPLDISPLAY46:0436/ssubSUB_OTHERS:%_*:0200/ctxt/COCKPIT/SHDR_DISP-RPA
    2. Same with Regex: wnd\[0\]/usr/subSUB_MAIN:/COCKPIT/SAPLDISPLAY46:0385/subSUB_HDR:/COCKPIT/SAPLDISPLAY46:0405/tabsG_STRIP_HDR/tabpTAB5/ssubSUB:/COCKPIT/SAPLDISPLAY46:0436/ssubSUB_OTHERS:%_.*:0200/ctxt/COCKPIT/SHDR_DISP-RPA
    3. You have the possibility to get a list of children for the wnd[0]/usr/subSUB_MAIN:/COCKPIT/SAPLDISPLAY46:0385/subSUB_HDR:/COCKPIT/SAPLDISPLAY46:0405/tabsG_STRIP_HDR/tabpTAB5/ssubSUB:/COCKPIT/SAPLDISPLAY46:0436/ component (with a Code stage for sure, but maybe even with a Read stage) - thus detecting the changing part. With this information you can set a Dynamic match mode for your element, where the you are calculating the ID based on that information.
  2. Instead of an Application Model, interact with SAP using a code stage (this is what I usually do). There you can emulate the above (1.3.) method, by getting the non-changing element's immediate children, and calculating the element's ID. The SAP GUI object model's documentation is pretty good. Once I faced the exact same problem you have, and this how I actually solved it.

Please note, I'm writing this answer at home, without currently accessing Blue Prism. Or SAP.

Upvotes: 1

Related Questions