Select combo box item by scrolling

7 posts, 0 answers
  1. Simon
    Simon avatar
    19 posts
    Member since:
    Jan 2011

    Posted 17 Apr 2011 Link to this post

    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?


  2. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 18 Apr 2011 Link to this post

    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
  3. Simon
    Simon avatar
    19 posts
    Member since:
    Jan 2011

    Posted 18 Apr 2011 Link to this post

    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.
  4. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 19 Apr 2011 Link to this post

    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
  5. Simon
    Simon avatar
    19 posts
    Member since:
    Jan 2011

    Posted 20 Apr 2011 Link to this post

    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

  6. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 20 Apr 2011 Link to this post

    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
  7. John
    John avatar
    8 posts
    Member since:
    Jul 2012

    Posted 18 Oct 2011 Link to this post

    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
Back to Top