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

How to scroll via code

5 Answers 105 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Travis Acton
Top achievements
Rank 1
Travis Acton asked on 17 Jun 2010, 07:15 PM

Any ideas(via code) how to scroll when combobox has been clicked and result set is not entirely visible?

Example.
I have a combobox that has 30 items and only the first 10 show without scrolling. In my coded test I have a loop that clicks on the combo box and checks if the item exists via find.byText. When looping through, it looks for items that are visible and keeps moving, If it cant find the item it hits the catch via timeout and I get my predefined error. Problem is it cant find items in the combobox that show only when the combobox is scrolled down. ANy ideas?
Code for example:

 

foreach

 

 

(PressImposition checkProd in Products)

 

 

{

 

 

 

    try

    {

 

 

        //Select Product Dropdown

        Pages.MMSPlugins_0.SilverlightApp.Item0Combobox.User.HoverOver();

        Pages.MMSPlugins_0.SilverlightApp.Item0Combobox.User.Click();

 

 

        TextBlock select = Pages.MMSPlugins_0.SilverlightApp.Item0Combobox.Find.ByText(checkProd.OfferingDisplayName);

        select.User.HoverOver();

        select.User.Click();

    }

 

 

    catch

    {

 

 

        Assert.Fail("Test Failed to Find Imposition Product");

    }

}

 

 

 

 

5 Answers, 1 is accepted

Sort by
0
Travis Acton
Top achievements
Rank 1
answered on 17 Jun 2010, 07:16 PM
p.s. Sorry for the horribly formatted code, the editor did something funky with it....
0
Travis Acton
Top achievements
Rank 1
answered on 17 Jun 2010, 07:29 PM
PLEASE DISREGARD, test was finding bug in code!
0
Cody
Telerik team
answered on 17 Jun 2010, 09:56 PM
Hello Travis Acton,

That's cool actually! We like hearing reports about how our tool was able to uncover a bug in the web application. Could you expound on what bug was found?

Kind 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
Travis Acton
Top achievements
Rank 1
answered on 18 Jun 2010, 01:41 AM
Bug was related to a service call that was bieng made on a event click.

After bug was fixed, I still had an issue with scrolling. Unless the option is visible it will not find the text (Silverlight combobox). In case anyone else has this issue, here is how I resolved it.

In the above foreach loop, after the Hover, Click actions, and before the find ByText action,  I added:

Pages.MMSPlugins_0.SilverlightApp.VerticalSmallIncreaseRepeatbutton.UserPress(250);


What this will do is scroll the combobox down slowely, then when it gets to the final element before you need to scroll, it will surface  just enough of the next element for be selected before it begins the search for it. It will continue doing so until the last element in the combobox is selected.

0
Cody
Telerik team
answered on 18 Jun 2010, 04:19 PM
Hello Travis Acton,

Thank you very much for that update!

Best wishes,
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
Tags
General Discussions
Asked by
Travis Acton
Top achievements
Rank 1
Answers by
Travis Acton
Top achievements
Rank 1
Cody
Telerik team
Share this question
or