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

2 posts, 0 answers
  1. Lisa
    Lisa avatar
    35 posts
    Member since:
    Nov 2017

    Posted 29 Dec 2017 Link to this post


    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?

  2. Elena
    Elena avatar
    1214 posts

    Posted 02 Jan 2018 Link to this post

    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! 

    Elena Tsvetkova
    Progress Telerik
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top