This is a migrated thread and some comments may be shown as answers.

Using the index from a variable to find another using Test Studio steps

1 Answer 148 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lisa
Top achievements
Rank 1
Lisa asked on 29 Dec 2017, 04:32 PM

Hello!

I want to preface this by saying we know how to do this with coded steps, I'm trying to ascertain if it can be done in the test studio step builder itself:

I have a set of what looks on the webpage like rows, but aren't in a table. We need to verify the phrase in the second "column" (the p). Since the "rows" might change in the future, I'd like to find the p based on the index of the label. The labels should stay constant.

I created a test step to extract the TagIndex from the label, so that I could get the correct containing div, and then I tried to use that Index in a find for the p but it doesn't work. I'm attaching the files that show the definitions of both elements, the part of the log file I can show you, and the part of the dom I can show you.

Is this something that just can't be done in the steps?

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 02 Jan 2018, 11:46 AM
Hi Lisa,

Thank you for all details shared. 

As of the information listed I would suggest to stick to the coded solution you have built already. The thing is that the label and the div which contains the p are on the same level and are siblings. Thus the find logic you are using to locate the p is searching for an element nested under the label which is not the case for the current application structure. 

The chained find expression is always looking for a child element. Therefore the approach currently built would not be working as expected although I suspect the index is being correctly extracted. As this is the structure of the application I guess the only possible approach would be the one to apply. 

I hope these details will be helpful to you. Though in case of further queries, please do not hesitate to contact us again! 

Regards,
Elena Tsvetkova
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Lisa
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or