Select first item in a list of changing items

4 posts, 1 answers
  1. Eric
    Eric avatar
    3 posts
    Member since:
    Jul 2011

    Posted 12 Nov 2012 Link to this post

    I'm using Telerik Test Studio Express. I'm recording the selection of an item in a grid (list elements <li>). The thing is, this list changes items all the time. So what i'm trying to do is select whatever the 'first' item is. It seems Test Studio selects items by name, and since the name will change, i want to select by 'order' i guess you can call it.

    any ideas?
  2. Mario
    Admin
    Mario avatar
    8 posts

    Posted 12 Nov 2012 Link to this post

    Hello Eric,

    Thank you for your interest in Test Studio Express.

    You can do this by altering the selection type from the properties of this Select step. Change 'SelectDropDownType' to 'ByIndex' and 'SelectionIndex' to '0' in order to choose the first option in the list regardless of its name or value.

    Please let me know whether you have any further questions.

    Kind regards,
    Mario
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Eric
    Eric avatar
    3 posts
    Member since:
    Jul 2011

    Posted 13 Nov 2012 Link to this post

    Thank you for your response. I believe i wasn't clear enough in what i was asking. I apologize, it was my fault. 

    Instead of 'selecting', i meant 'clicking'. I have a list of items (images) within a unordered list.
    Pseudo code:
    <ul><li>[image id=1234]</li><li>[image id=5678]</li></ul>.

    Right now the test has recorded that i clicked a specific image name (in the example, it will have recorded that i clicked the image with the id=1234). But this image (and its id) is dynamic and will change. This is expected and is ok. It doesn't matter the image name, i just want for the test to always click the 'first' image in the list, regardless of its id.

    is this possible?
  4. Answer
    Mario
    Admin
    Mario avatar
    8 posts

    Posted 13 Nov 2012 Link to this post

    Hi Eric,

    Apologies for my oversight of your original explanation and thank you for the additional information. You can still do this by creating a Chain Find Expression for locating this element using the Elements Explorer. With your simple example it would look like the attached image.

    Let me know whether this solution helps.

    Kind regards,
    Mario
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!