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

Select combo box item by scrolling

6 Answers 263 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 18 Apr 2011, 03:24 AM
My application includes combo boxes. One of my tests requires the selection of an item in the combo box which isn't visible when you first open the combo box: I open the combo box; it displays the first 6 items; I need to select the 10th item.

I can record the action of scrolling the combo box. However, this recorded step then includes specific x/y pixel references: "Drag BackgroundGradientRectangle to application at (297, 432) from TopLeftCorner."

When I play back the test, it often fails at this step. No selection is made in the combo box if the screen size is slightly different than when the test was recorded.

How do I get my test to consistently select the 10th item in a combo box, even if that item is not visible when you first open the combo box?


6 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 18 Apr 2011, 12:59 PM
Hi Simon,
    you can try to work around this by using "blind" mouse clicks to move the scroll-bar. Here's how to record "blind" mouse clicks:
http://www.telerik.com/automated-testing-tools/support/kb/invoking-blind-i-e-element-independant-mouse-clicks.aspx

I'm not 100% sure this will work. Give it a try and let us know how it goes. If you're still unable to resolve this automation task we'll come up with a different solution for you.

Best wishes,
Stoich
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
Simon
Top achievements
Rank 1
answered on 19 Apr 2011, 01:20 AM
Stoich, thanks for your help. However, that proposed solution of "blind" clicks is almost the OPPOSITE of what I need. I need to be able to click on an item in a combo box, where the item is NOT currently shown on the screen (that "blind" click scenario assumes that I can see what I want to click on).

How do I get my combo box to scroll down to an item which I can't originally see, so I can select it in my test?

I've attached two screen shots. In the first one (Site1), you can see the combo box as it is when it first opens. I need to scroll down the list, to find Site 001 (Site2).

How do I do this? I am recording the step of "Drag BackgroundGradientRectangle ..." when recording the test, but it doesn't perform this step when running the test.
0
Stoich
Telerik team
answered on 19 Apr 2011, 11:00 AM
Hello Simon,
    it seems there was some miscommunication between us. My suggestion was to try to use the clicks to move the scroll bar (screenshot 1). Another thing you could try is using the scroll actions from the popup menu (icon in bottom-right corner). However, it has a rather limited functionality so it might not do the trick (screenshot 2).

All the best,
Stoich
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
Simon
Top achievements
Rank 1
answered on 20 Apr 2011, 05:53 AM
Thanks, Stoich.

Recording the "click" on the scroll bar does work. I will have to record multiple clicks for longer combo boxes.

Recording the scroll bar operation "Scroll to bottom of window" does not work - you might want to look at this further.

Simon

0
Stoich
Telerik team
answered on 20 Apr 2011, 08:27 AM
Hello Simon,
   you're right. "Scroll to bottom of window" doesn't work on comboboxes. I've logged this as a bug.

Meanwhile please let me know if you have any additional questions!

Greetings,
Stoich
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
John
Top achievements
Rank 2
answered on 18 Oct 2011, 05:38 PM
I did find that if you highlight the item you want to scroll to and state scroll to the top of the item then it will work.

just my two cents,
John
Tags
General Discussions
Asked by
Simon
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Simon
Top achievements
Rank 1
John
Top achievements
Rank 2
Share this question
or