There are various functions for interacting with subgrids, which are listed below.
Gets the number of records that are currently displayed.
const count = await xrmUiTest.Subgrid.getRecordCount("subgrid1");
Opens the update form for the record at position n.
await xrmUiTest.Subgrid.openNthRecord("subgrid1", 1);
Refreshes the subgrid
await xrmUiTest.Subgrid.refresh("subgrid1");
Takes care of opening the tab where the subgrid resides and clicking its "Add New Record" default button. If the button is hidden inside the overflow menu, the overflow menu is searched as well.
Note:
If the button fails to get clicked, check user permissions, button hide rules and whether you use custom create buttons, as we search for the default create button
await xrmUiTest.Subgrid.createNewRecord("subgrid1");
Generated using TypeDoc