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

Select first item in a list of changing items

3 Answers 218 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Eric
Top achievements
Rank 1
Eric asked on 12 Nov 2012, 10:00 PM
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?

3 Answers, 1 is accepted

Sort by
0
Mario
Telerik team
answered on 12 Nov 2012, 11:32 PM
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
0
Eric
Top achievements
Rank 1
answered on 13 Nov 2012, 03:50 PM
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?
0
Accepted
Mario
Telerik team
answered on 13 Nov 2012, 06:39 PM
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
Tags
General Discussions
Asked by
Eric
Top achievements
Rank 1
Answers by
Mario
Telerik team
Eric
Top achievements
Rank 1
Share this question
or