Reputation: 1280
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
Upvotes: 0
Views: 285
Reputation: 2859
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.
Upvotes: 1
Reputation: 714
SilkTest has a framework for supporting such custom controls and a nice tutorial here Theoretically you would have to:
Of course as the tutorial tells you, if you do not want to always do these iterations you should create some higher level utilities where you can just get the Cell at once. Example: GetGridViewRowCell(gridView, cellRow, cellColumn) where cellRows can be a more sophisticated filter object where you describe which cell must have which value in order to identify the proper row
Upvotes: 2