I have a table similar to below in a WPF application. We are using Silk Test 17.5 using VB.NET.
Table is dynamically loaded based on latest data. I need to click on 'Default' ( Link) for specific row.
e.g. I need to click on 'Default' link for Trump1 , Trump2 row.
How should I do it? All locators of default links are same and I cannot differentiate between them. Is there any I can append First Name locator to Default to figure out which locator to click?
Tokci
Assuming the table has a hierarchical structure similar to HTML, you should be able to do the following:
//WPFDataGridCell[@text='Obama']
...
.WPFDataGridRow
, search down again for the row's "Default" link with //WPFHyperLink[@caption='Default']
.Putting it all together, you'll get a locator like //WPFDataGridCell[@text='Obama']/..//WPFHyperLink[@caption='Default']
.
Of course this is only an example based on the information you provided, so if you try it, make sure to pick the attributes with Silk Test's locator spy to make sure you get the correct values.