Page 1 of 1

Unable to select a row when the table is embeded in GUISHELL object in SAP application

Posted: Wed Feb 06, 2019 12:17 pm
by deabh
Challenges:
1. Table object is not getting identified as a single element. Entire “GUISHELL” object is getting selected while spying.
2. We can uniquely identify objects in granular level (e.g. Rows/Cells/etc.)
3. However, none of the row functions are not working.

WorkAround (Not Recommanded):
1. Click on a row using relative loction.
2. Press Shift key down
3. Click on 2nd row using same relative loction.
4. Press Shift key up

Below is the code snippet:
//Does not work - selecting a row when the table is embeded in GUISHELL object
Approach1:
repo.AUT_SAP.ContainerUsr.Row0.Element.SetAttributeValue("selected",true);
Approach2:
repo.AUT_SAP.ContainerUsr.Row0.Select();
Approach3:
IList<Row> rows = repo.AUT_SAP.ContainerUsr.GuiShell.FindDescendants<Row>();
rows[0].Select();
rows[0].Element.SetAttributeValue("selected",true);

//Does work - selecting a row when the table is embeded in GUISHELL object
repo.AUT_SAP.ContainerUsr.Row0.Click("6;11");
repo.AUT_SAP.ContainerUsr.Row0.PressKeys("{LShiftKey down}");
repo.AUT_SAP.ContainerUsr.Row1.Click("6;11");
repo.AUT_SAP.ContainerUsr.Row1.PressKeys("{LShiftKey up}");