cancel
Showing results for 
Search instead for 
Did you mean: 

SAP spied element changing its path automatically

SagarBiswas2
Level 2
I am Using Blue Prism on SAP application. Some times some elements is not highlighting to the element that I have already spied using sap mode. I check the ID field after spying an element and when it is giving me error and found it is actually changing a value in total the path. I am giving screenshot this will help to better understand.   Giving an example: After spying an combo box in SAP I got element id field value is : /app/con[0]/ses[0]/wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB0:SAPLMEGUI:0030/subSUB1:SAPLMEGUI:1105/cmbMEPO_TOPLINE-BSART but after sometimes it changes to :  /app/con[0]/ses[0]/wnd[0]/usr/subSUB0:SAPLMEGUI:0021/subSUB0:SAPLMEGUI:0030/subSUB1:SAPLMEGUI:1105/cmbMEPO_TOPLINE-BSART.   This above id which is changing is random. Sometimes it is showing 0015 or sometimes it is 0010 or 0021.   I need a fix for this ASAP.
6 REPLIES 6

Denis__Dennehy
Level 15
I think your fix is probably going to be surface automation.

JosephGarro
Level 3
Would applying a wildcard on the element work?   like wild card = /app/con[0]/ses[0]/wnd[0]/usr/subSUB0:SAPLMEGUI*   I had similar issue with the toolbar capturing it with UI Automation mode.   Isn't SAP fun?

JosephGarro
Level 3
Or maybe a regex?

ShailendraSing1
Level 3
Hi Sagar, I think you are spying /Cockpit or any TCode starting with ""/"", where SAP Mode is not working as required. Either use AA Mode or use TABs to reach to that specific element. I think wild char will also not work. If we build logic for this dynamic values it will slow down it. Please let me know if you able to find out other solution from this.  

SachinBais
Level 4
Hello Sagar, i faced the same problem while automating the SAP, So the work around is very simple spy both the element and while using that element you can use the Check exist wait condition  Please check Both the element on wait check exist if any one of them found follow that element. Just assume you have text box A and its ids are xx/xx/0013/xx and xx/xx/0021/xx so you can spy both element. while using Text box A you need to see which element exist Either 0013 or 0021 so you can use wait stage with both element check exist and afterwards you can configure the element  Hope this will resolve your problem Please let me know if it helps  

Nandhakumar
Level 6

Hi Guys,

I have faced the same issue recently, where the attribute works fine when i spied the element and next time it failed due to change in the attribute value for few SAP elements. I have found the reason for that added a logic to handle that hope this helps.

Reason - Why the attribute element changes:

My situation where I'm working with PO Tcode, as soon as i open a PO it gives 3 sections in SAP 1. Header, 2. Item Overview and 3. Item Details. All the sections are expand and collapse type elements.

When i spied an element in 1. Header section by keeping the 2 & 3 section expanded view then the attribute is giving "/app/con[0]/ses[0]/wnd[0]/usr/subSUB0:SAPLMEGUI:0013/subSUB0:SAPLMEGUI:0030/"

when i collapse section 2 & 3 that time i get " /app/con[0]/ses[0]/wnd[0]/usr/subSUB0:SAPLMEGUI:0016/subSUB0:SAPLMEGUI:0030/"

Likewise, when the other section in the SAP screen IS visible or not based on this the value of the attribute changes.

Solution:

 I have found there are 3 variance for the same element and used that as dynamic value and checked using check exists in wait stage. If match found then use the same value across all the elements to interact with it.

I hope this helps you in case if you have faced similar scenario in SAP.



------------------------------
Nandhakumar C
Technology Consultant
SimplifyNext Pte Ltd
Singapore
------------------------------