Retrieving an XPath element
To complete actions with the element parameter, you must create a SAP element. To do this, you need to open SapSpy.
Click on the triplet near the "Element" field.
Next, the button
In the window that appears, click the SapSpy button
A window will be opened:
- Create a new connection (enter account details, then click "Connect")
- Or connect to an open SAP account (select the account, click "Connect").
To get the item id, the "Capture" button is applied, then CTRL+left mouse click.
After the item is captured, click the "Stop" button.
To check if the capture is correct, click the "Find" button - SPY circles the found element with a red frame.
As xpath you need to get session+id – /app/con[0]/ses[0]/wnd[0]/usr/tblSAPMP50ATC_MENU_EVENT
If more than one SAP window is used in a work, the xpath of the element is changed accordingly:
- first open window - /app/con[0]/ses[0]/wnd[0]/usr/tblSAPMP50ATC_MENU_EVENT
- second open window - /app/con[0]/ses[1]/wnd[0]/usr/tblSAPMP50ATC_MENU_EVENT
- etc.
Getting Xpath table
The same table xpath is used to handle the "Click table cell", "Get table", "Enter text in table cell" and "Get table cell" actions.
- In case the table has the form tbl:
To do this, select the desired cell in the table, or the table itself, then the resulting xpath
/app/con[0]/ses[0]/wnd[0]/usr/tblSAPMP50ATC_MENU_EVENT/txtT529T-MNTXT[0,12]
is reduced to the xpath of the table:
/app/con[0]/ses[0]/wnd[0]/usr/tblSAPMP50ATC_MENU_EVENT
The resulting xpath is then used to create an element that applies to both tables and table cells:
And the address of the cell in the table ([0,12]) is entered into the action parameters themselves:
- In case the table has the shell form:
The resulting xpath is not abbreviated, and the address of the cell in the table ([0,12]) is also entered into the action parameters themselves.