Row/Cell has wrong visible property

Bug reports.
Pavlo
Posts: 43
Joined: Fri Dec 30, 2011 10:55 am

Row/Cell has wrong visible property

Post by Pavlo » Tue Jan 24, 2012 8:39 am

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.
Attachments
ScrollBar_at_Bottom.rxsnp
(152.24 KiB) Downloaded 174 times
ScrollBar_at_Top.rxsnp
(150.84 KiB) Downloaded 169 times
contacts.PNG
contacts.PNG (25.99 KiB) Viewed 1583 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Row/Cell has wrong visible property

Post by Support Team » Tue Jan 24, 2012 10:22 am

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
.
Image

Pavlo
Posts: 43
Joined: Fri Dec 30, 2011 10:55 am

Re: Row/Cell has wrong visible property

Post by Pavlo » Tue Jan 24, 2012 11:32 am

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)

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Row/Cell has wrong visible property

Post by Support Team » Tue Jan 24, 2012 1:52 pm

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
.
Image

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Row/Cell has wrong visible property

Post by Ciege » Tue Jan 24, 2012 3:38 pm

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.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

Pavlo
Posts: 43
Joined: Fri Dec 30, 2011 10:55 am

Re: Row/Cell has wrong visible property

Post by Pavlo » Thu Jan 26, 2012 7:30 am

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!