Page 1 of 1

Row/Cell has wrong visible property

Posted: Tue Jan 24, 2012 8:39 am
by Pavlo
Hi

I'm evaluating Ranorex 3.2.1 to test desktop application with controls inherited from DevExpress.
On one from froms, there is table (grid) with 12 rows, and only 10 of them are visible (also scrollbar exists so all of rows can be accessed).

When scrollbar is at top position => Ranorex Spy treat row 11 as visible and row 12 as not visible. But in fact both row 11 and 12 are not visible.

When scrollbar is at bottom position => Ranorex Spy shows that both row 1 and row2 are not visible (and this is absolutely correct).

Attached are 2 scnapshots with detailed info.

Re: Row/Cell has wrong visible property

Posted: Tue Jan 24, 2012 10:22 am
by Support Team
Hi,
Pavlo wrote:When scrollbar is at top position => Ranorex Spy treat row 11 as visible and row 12 as not visible. But in fact both row 11 and 12 are not visible.
It looks like that row 11 is partially visible. This means if 1px of the control is visible the whole control is shown as visible. But this should be no problem, because if you click on this element, Ranorex tries to make this control entirely visible. Did you try to use EnsureVisible on this cell?

Regards,
Peter
Ranorex Team

Re: Row/Cell has wrong visible property

Posted: Tue Jan 24, 2012 11:32 am
by Pavlo
Hi

I've tried to click on row 12

Code: Select all

string cellToFind = "//row/cell[@accessiblename~'"+columnName+"' and @accessiblevalue='"+value+"']";
IList<Cell> cells = table.Find<Cell>(tableXPath + cellToFind);
foreach (Cell cell in cells)
{	
    bool isCellVisible = cell.Visible;
    bool ensureVisibleResult = cell.EnsureVisible();
    cell.Click();
}
After this code execution:
isCellVisible = False;
ensureVisibleResult = False;
cell.Click() => clicks on coordinates 0,0 (or something like that, top-left corner of screen)

Re: Row/Cell has wrong visible property

Posted: Tue Jan 24, 2012 1:52 pm
by Support Team
Hi,
Support Team wrote:After this code execution:
isCellVisible = False;
ensureVisibleResult = False;
cell.Click() => clicks on coordinates 0,0 (or something like that, top-left corner of screen)
Please try the Select method for your cell object or set the property Selected to true.

Regards,
Peter
Ranorex Team

Re: Row/Cell has wrong visible property

Posted: Tue Jan 24, 2012 3:38 pm
by Ciege
I have this same issue with my DevExpress grids... I've solved it with my own ClickCell method that checks for Visible and then checks the Y + Height of the cell versus the Y + Height of the grid. If the bottom of the cell is off screen after my calculation then I find the Line Down button of the vertical scroll bar and click once.

Re: Row/Cell has wrong visible property

Posted: Thu Jan 26, 2012 7:30 am
by Pavlo
Ciege wrote:I have this same issue with my DevExpress grids... I've solved it with my own ClickCell method that checks for Visible and then checks the Y + Height of the cell versus the Y + Height of the grid. If the bottom of the cell is off screen after my calculation then I find the Line Down button of the vertical scroll bar and click once.
Hi

I had same idea in my mind, but think that re-implemeting property visible is not bext idea, so solved issue in another way.
Since I want to click cell to select the row, I'm calling DoDefaultAction from Accessible.
It works well even if cell/row is visible just for 1 pixel and also works well and selecting row (and scrolling to required row) in cell/row is not visible at all.

Code: Select all

Accessible accCell = cell.As<Accessible>();
if (accCell.DefaultAction.ToLower() == "focus")
{
    accCell.DoDefaultAction();
}
Even more, I already created one more method that is looking for row in grid by values in multiple cells (Column1->Value1, Column2->Value2, ...)

Thank you all guys!