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

DropDownList and UITest : Scrolling

0 Answers 113 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
issamo
Top achievements
Rank 1
issamo asked on 11 Apr 2012, 07:54 AM
Hello,
I'm facing a problem with the dropdownlist :

Hello,

I just want to click on a specific item in the list, on my local machine the following code works perfectly :
 public static void ClickScrollableControl( HtmlDiv uIPointsList, User accessPoint)
{
   HtmlCell uICell = uIPointsList.GetControl<HtmlCell>(HtmlControl.PropertyNames.InnerText, accessPoint.Name)
Mouse.Click(uICell);
}

the playback engine scroll till the cell is visible, and it click on it.

When running the same code on the TestAgent (log automatically), the scrolling doesn't work.

My question is just how to scroll manually. I've tried this code but without success :

 public static void ClickScrollableControl( HtmlDiv uIPointsList, User accessPoint)
{
   HtmlCell uICell = uIPointsList.GetControl<HtmlCell>(HtmlControl.PropertyNames.InnerText, accessPoint.Name)
Mouse.Click(uICell);
Rectangle uICellRectangle = uICell.BoundingRectangle;

Rectangle uIPointsListRectanle = uIPointsListRectangle.BoundingRectangle;

int wheel = 1;
 while (!uIPointsListRectangle.Contains(uICellRectangle))
 {
     Mouse.MoveScrollWheel(wheel);
     wheel = wheel + 1;
          
     HtmlCell uICell = uIPointsList.GetControl<HtmlCell>(HtmlControl.PropertyNames.InnerText, accessPoint.Name)

    Rectangle uICellRectangle = uICell.BoundingRectangle;
  }

Mouse.Click(uICell);
}

it doesn't scroll at all !!!, any idea ?

No answers yet. Maybe you can help?

Tags
DropDownList
Asked by
issamo
Top achievements
Rank 1
Share this question
or