Get the current UiElement, Dinamically

Hi,
My activity enter a Customer Web page, with an embedded SAP-Gui.
On this SAP-Gui there is a Table.
The Activity has to check a specify Table column (Status).
If Status != “some value”, edit two fields of the same row (different columns)

Here my problem:
The indexes (of columns and rows) change every time i reload the page (checked with UiExplorer) ;
I tried with a "click text " activity (-> the selector is the whole WebPage) but nothing;

My idea for a workaround is:
Load the Page;
“Click text” on the Table-Column Headertext (works), then “Send Hotkey” Arrow Down (the cursor moves on the first Table row, on the right Column -> “Status”. Here I need an activity to get the actual UiElement (where the cursor is placed by the Arrow-Down activity), in order to be able to read the Cell Text, or get the Cell Attributes.

Someone know more ?

First, do you have SAP GUI scripting enabled? (see here), so the order of the table columns keep changing? so you cant grab thing using their indexes?

1 Like

Hi,
the SAP GUI is integrated on the browser.
This GUI is showed me when i click certain buttons on the customer portal.
No browser popup to allow/deny permissions;
No browser-addons are installed by opening the Gui’s;
Furthemore: two differents Gui’s are showed (two different department at customer side).
The first one, the “Classic” SAP Gui give me trouble to identify table columns/rows, the newest No.

(As detail: the Local RPA Desktop has a company installation of SAP-Gui, which is scripting enabled)

Howewer, i realyzed a workaround using hotkeys.
Going back to my first question:
Is there an activity to get the current UiElement properties?
For example, my activity send three Keyborard-Tab -> i want to know which is the control selected from the cursor after the three-Tab’s

I think there is no built in activity in uipath to get the active element, but javascript has access to this ( document.activeElement ) and maybe you can use Inject JS Script activity to try to get it, im sorry i dont have a lot of experience with this to further assist you on that.

Hi,
Have you tried ‘Find relative element’ and ‘Set Focus’ activities?
With regards to ‘Find relative element’, you’ll be able to output the desired UiElement to play around with.

Best of luck!

*Forgot to add - if you do use ‘Find relative element’ along with e.g. Click activity:

Within the click activity, you’d insert the name of the ‘Find relative element’ output variable within the Click activities 'Target > Element property.
I’m sure the same can be done for retrieving information from the table you’re looking to interact with by playing around with the other UiPath activities on offer.

I have kind of similar requirement for which I need to find the tableRow property of selector of an active cell in sap table.
Were u able to get it ? Can u share

Hi,
to solve my first issue, i moved my process from IE11 to Firefox: this grant me to have better selector properties, which let me find the index for SAP columns & row data. (Furthemore, the migration to Firefox let me solve other browser-related issues)
Regarding your requirements, do you need to find out the tableRow property on a SAP “Standalone” GUI?
I’ve something similar: i’ve to scroll a Sap-Gui Table and check certains cell values.
I’ve builded a dinamically selector:
sap id=‘usr/tabsTAXI_TABSTRIP_ITEM/tabpT\0*/ssubSUBSCREEN_BODY:SAPMV45A:4602/tblSAPMV45ATCTRL_PEIN_ABRUF/ctxtRV45A-ETDAT[1,%ct%]’
where [1,%ct%] is the address of the cell to be checked
(1 is the column index, %ct% is the rowIndex, which is increased +1)

Hope this can help you

Thanks for your response, I resolved it yesterday by using Data Scrapping and then looping on data to get the SAP Line Item No. Table Row was easy to find with some maths using SAP Line Item No. Thanks again

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