DropDownList and UITest : Scrolling

1 posts, 0 answers
  1. issamo
    issamo avatar
    1 posts
    Member since:
    May 2011

    Posted 11 Apr 2012 Link to this post

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