How to find element on screen with only one of attribute known

Hi,

I am working on SAP and I have to find out a particular entry with a known document id in a few thousand entries.
the challenge I am facing here is document iD is an attribute that is not a part of the selector.
By using Get Attribute- I can fetch a particular attribute of a selector but how to do vice-versa?
With a known attribute can I find the selector. Can anyone suggest in detail how to find it.

For instance:-
on using UiExplorer

How can I make “text” attribute a aprt of selector as shown in image below.

Responses are welcome

Hi @RK_S ,

Could you also provide Screenshots of the UI Element that needs to be found/Selected.
It would help us to understand if there is an alternate method to achieve the same operation.

However, Have you tried adding the attribute manually to the Selector and Checked if it works?
Also, In the right hand side of the UI Explorer, we have some other attributes which might not be Selected and could be added to the Selector. Does the Value you need appear in that list ?

Unfortunately NOT, the attribute values are not listed in the selectable window- see below screenshot:-
The core question remains same: Is there any way by which we can add these attributes to selectors to identify the row in the list of data.

Hi @RK_S ,

Could you please do reverse engineering like add text=‘1876329’ in the selectors and remove id and table row and try highlighting. if it is working fine we can replace the specific number with dynamic selectors. just sharing my thought. thanks.

Already Tried adding text and with a few other attributes but upon adding it is not validating the selector.

@RK_S ,

Have you tried using a Filter Toolbar if at all Present in the SAP part of the Application that you are using?

As we do not have a visual on the SAP Screens that you are using and as you have mentioned that there would be around 1000 entries. There should be an option to Filter out the Required data/items, So that you can directly filter the Document ID number and then take the Filtered Result into consideration.

Let us know if it is already tried or you’re looking for a better solution.

@supermanPunch thanks for suggesting,
I have already tried this - after clicking on column Name and then filtering with the document id
but stuck at clicking on the column name- selectors are fine and recognisable but getting error " Click ‘GridViewColumn Document’: Action not supported by this type of element. Please use another type of click."

also tried few other options:-

  • mouse double-clicking - not supported this action

  • click text screen scraping - again not able to scrapable and not want to use ocr

Hi @RK_S ,

Please check the filter feasibility for your application suggested by @supermanPunch. Mean while could you test with the below selectors i suggested and try highlighting. thanks.

@RK_S ,

One Other Thing, whether a Attach Window is being used with the window Selector and does the Click Activity on the Column have a Partial Selector.

If not tried with this approach, can you check if it works by making the changes in the Selector?

HI @RK_S

To be able to understand your automation challenge better, please share following information:

  • SAP WinGUI version
  • SAP WinGUI transaction

In addition share the following screenshots:

  • SAP WinGUI screenshot - Full screen (you can blurry the business information)

Best regards, Lev

You can’t build a selector based on the attributes in the ‘property selector’ directly. The only options available are the items on the right side in the explorer.

To solve this there are a few techniques you can try.
Other than trying to use CV / OCR and anchors, this is what I woud try:

  1. Find a parent item/selector that is stable and selectable. Often the direct parentnode is sufficient, but maybe you need to go up further.
  2. Now use a ‘find children’ activity to get all direct decendants.
  3. loop through all items found (for each) and check the text by using get attribute on each element.
  4. if the text matches your item, break the loop and you just got your element to do with as you please.

If this is a sequence you need to do multiple times I reccomend making it a reusable (library) component where a parentID and child attribute key/value for lookup is entered, returning the element found. Makes it a wee bit more generic.