Question

Hello, I am getting the error "Unable to find LABEL. Search Criteria did not match" while automating the process in SAP. I tried many ways but without success. Very happy if you help. Thank you in advance for your answers.

  • 5 April 2022
  • 3 replies
  • 294 views

imageimage


3 replies

Userlevel 5
Badge +9

Hi @Sibel Akçay​,

 

Thanks for posting your query.

 

Please follow the steps provided in the below KB article to fix this issue:

https://apeople.automationanywhere.com/s/article/Object-Cloning-Unable-to-find-Object-Search-criteria-did-not-match

 

Note: Only registered customers/partners can access the Knowledge base articles.

 

Regards,

Vijay

Badge

Hi @Sibel Akçay​,

 

Thanks for posting your query.

 

Please follow the steps provided in the below KB article to fix this issue:

https://apeople.automationanywhere.com/s/article/Object-Cloning-Unable-to-find-Object-Search-criteria-did-not-match

 

Note: Only registered customers/partners can access the Knowledge base articles.

 

Regards,

Vijay

 

Why is this information only available to customers and what does that even mean?

Userlevel 2
Badge +8

@Chris 621 Yeah, I am not sure why so much of the documentation has recently been put behind a paywall; makes no sense. In essence, the article being pointed basically says “could happen for a lot of reasons”.

@sibelakcay  Here are a few suggestions based on what I see most often from my own customers:

  • When you capture an element (label, button, etc.) the XPath to that element on the page is dynamic somehow.

If you look at the attributes captured along with an element, there are many that AA automatically captures to help it identify the object. If you expand the list, you’ll see even more:

Capturing a label on linkedin.com login page:

 

And the element attributes captured:

 

Notice it captures 47 attributes, but only 7 are in use. Aside from the first three, which you cannot change, the most important is probably the XPath, which shows the path right to that element on the page. However, many modern pages will make this XPath dynamic or even randomize it through the source code, making it difficult to capture. I would start with capturing the element a couple of times, and noting whether there are differences in the XPath between captures. If so, you know what to work on; otherwise, you can move on to other things.

As for the latter possibility, since that is easier, if the XPath is the same each time, I usually uncheck everything BUT that attribute. Then, if the element still isn’t captured, I expand the list and start adding attributes back in one at a time until I find a combination that works. I stay away from any resolution-based attribute (Top, Left, Height, etc.) until I have run out of other options, as these can be unstable.

If the XPath IS changing, then you have a couple of options. If the is changing along specific lines, say for example the XPath is this:

and sometimes it is /div[1]/, others it is /div[6]/ or /div[3]/, you could try a loop in a Try/Catch block, something like this (pseudo-code):

Loop however many times is appropriate

 

Inside each loop use a Try/Catch. Use your $iCatch variable to replace the text in the XPath:

 

If you get the property you’re expecting, break out of the loop and continue your bot. Otherwise, it keeps trying however many times you set the loop for.

 

Lastly, if the XPath is changing, and it is completely random (or not of a pattern you can handle with a loop), your easiest way forward is to use AI. There is a great example of this in the latest Bot Games video, which provided exactly this scenario. Here is a link to that video; well worth a watch. I have had to implement this more than once already with customers where the page modified the XPath every single time it was loaded.

 

Hope you find something of benefit in this word wall. Good luck on resolving your issue.

 
 
 

Reply