william_roe
11 years agoSuper Contributor
Selecting Item(s) in Dynamic, Multi-select lists in Data-Driven Test
How do you create a data-driven test which checks item(s) in a list using a value and not a mapped object? I created a data-driven test with multiple if statements which clicked on the mapped object only to discover the items in the list are dynamic so this approach will not work.
- Hi Keith,
You can use the FindChildByXPath method. Here is the sample that obtains the check-box element based on the value specified in the Description column:
var grid=//...obtain the grid object:
var obj = grid.FindChildByXPath("//td[text()='Administrator Access']/parent::node()//input", false);
To learn more about XPath expressions, I suggest that you refer to this tutorial.