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

Problem Automating List Boxes

4 Answers 133 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 02 Sep 2011, 03:04 PM
Hello

We have been trial running Telerik Test Studio for some time now and we have found a problem automating the lists control.

We have used a List Box control with a collection of inputs set at each level for each element. We have found that it is not possibly to repetitively automate this list box because it needs to find the text box for an element that does not exist at the time when the test was recorded.

What would be the correct approach to iteratively automating this control? inserting an element onto the end of the list regardless of how many elements are already in the list.

Thanks for any assistance
Alex

4 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 08 Sep 2011, 09:21 PM
Hi Alex,

I apologize for the delay responding to you (we're temporarily overwhelmed in support).

What type of application are you trying to test (Silverlight, HTML, WPF)? Since I haven't seen your application I don't really understand the test automation scenario you are facing. Can you elaborate more on the steps required in your automation, and include screen shots of what the UI looks like so I can get a clear understanding of the problem you are facing?

Is there anyway I can get direct access to your application so I can better assist you with this automation challenge? If I can access it direct I can create a ready made solution that works instead of merely guessing and suggesting ideas to try.

Kind regards,
Cody
the Telerik team
Vote for Telerik Test Studio at the Annual Automation Honors Voting!
0
Alex
Top achievements
Rank 1
answered on 20 Sep 2011, 02:27 PM
Hello Cody

My apologies for taking so long to get back to you.

I have been refining my question and it should now be a bit more concise, there are also some screenshots to accompany it.

The scenario is thus:

We have many list boxes around our in browser silverlight application, in our test we require the ability to add more than one item during the course of a single test and save the record. The example in the screenshots is for our roles screen. When you click the Add button, a new list item is added and a new form is populated in the list item (addingfirstextralistitem.png) you click save and it saves the list item back to the database.

I have been able to automate this quite successfully

The problem comes when you try to add two list items at a time in the same test (addingsecondextralistitem.png). The little form that is added can have new automation IDs set, so the first set of fields on the first list item might have been IDText1 and DescriptionText1 the next set of fields could be IDText2 and DescriptionText2.

I have been having difficulty using the element finder to pick up the n-th item in the list or the n-th instance of a field on the form. I have tried to use a variable like IDText{CurrentIDField} but I have not got it to work within the element finder either.

Is this possible?

P.S. I am having to avoid going down the coded step route so these UI tests can be made by non programmers!
0
Accepted
Cody
Telerik team
answered on 21 Sep 2011, 07:38 PM
Hello Alex,

Thank you for the clarification. It is much more clear to me now the automation problem you are faced with.

First, as a clarification, Test Studio does not support data driving the element finder. Using code we could create a data driving find expression, but I understand you want to try and avoid using code.

If I understand correctly what you are really after is to be able to Add a new role, then find and fill in the form for this new role... and for the automation script to be able to do this not knowing how many existing roles were already present when the script runs. Do I understand the challenge correctly?

Unfortunately the Find Expressions that Test Studio supports does not include the concept of "find the last element of type X" and work from there. We can locate elements having a specific set of attributes, or find elements having a specific index value (e.g. locate the 12th label counting from element X), and even the ability of a chaining finds together i.e. find element X then underneath that find element Y.

I wonder if a chained find could be used in your case. For example, if the currently opened form (assuming you can only have one open at a time) always had the automation ID of "OpenedForm" as a static ID, we could use a chained find that would find the form having that ID and then find the input elements it contains by an index number. Is something like this possible in your application?

The only alternative is to implement something in code that can reliably find the right elements to act on, and perform the needed actions.

Regards,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alex
Top achievements
Rank 1
answered on 13 Oct 2011, 12:13 PM
Thanks Cody

We went down the chained find route. finding down to just outside of the list box then having the automation IDs of the list items numbered meant that we could individually itentify each list item. Another step in the chain to find the text box we needed in that list and we are sorted.

Cheers
Tags
General Discussions
Asked by
Alex
Top achievements
Rank 1
Answers by
Cody
Telerik team
Alex
Top achievements
Rank 1
Share this question
or