Page 1 of 1

How to get Hidden Ele(Not available in Screen display))

Posted: Wed Mar 09, 2011 3:50 pm
by thangavel
We are automating Silver Light Application
We have to get Collection of Elements from a Table.
There are 500 Elements.
20 elements are available in Screen display. Others are not in screen display, but available in the Application.

I want to get the 499th Element which is not visible in screen display. Unable to get the Element. Throwing Exception.

//Working
Ranorex.Table tblSupplier = pilstMainTabPage[0].FindSingle<Ranorex.Table>("<RxPath Of the Table>");

//The Below code is working if the Element is available in Screen display
//The Below code is NOT working if the Element is NOT available in the Screen display

Ranorex.Text txtSupplierHdr = tblSupplier.FindSingle<Ranorex.Text>(".//text[@name='12345']");

How to get Hidden object? (Its Type is Ranorex.Core.Element)

Re: How to get Hidden Ele(Not available in Screen display))

Posted: Wed Mar 09, 2011 6:02 pm
by Ciege
Is it truly valid but not visible or does it truly not exist unless needed?
Some apps will not create an unneeded element until there is a use for it. In that case, the element may in fact be a valid element within your AUT when it is being used, but may not exist when it is not being used.

Can you use Spy to verify that the element does indeed exist but is just marked as visible=false?

You can also use Ranorex to get an iList of all elements (of a certain type) that are valid within your AUT then parse that list yourself and check if the element exists or not at any given time.

Re: How to get Hidden Ele(Not available in Screen display))

Posted: Thu Mar 10, 2011 7:55 am
by thangavel
Object is valid and Visible = true. But it is not displaying in the current Screen. It is below the Screen. Refer the screenchot attached. I've pointed (Red arrow) the required object's location in the screen. I Used UseEnsurevisible(). But No use. We need to focus on the object and it should be clicked.

My requirement is to make the object visible into current screen location when I focus on it.

I can scroll the browser to make the object come within the screen display. But without scrolling the browser, How to make the object automatically "Visible"/ Focus into Screen Display.

Re: How to get Hidden Ele(Not available in Screen display))

Posted: Thu Mar 10, 2011 12:38 pm
by Support Team
Hi,

Would it be possible to send us a Ranorex Snapshot of the entire application to analyze the issue in more deep?
How to create a snapshot:
http://www.ranorex.com/support/user-gui ... files.html

Is this WPF control embedded in a browser?
Is this WPF element a custom control or just a standard datagrid?

Thanks in advance.

Regards,
Peter
Ranorex Team

Re: How to get Hidden Ele(Not available in Screen display))

Posted: Fri Mar 18, 2011 8:31 am
by thangavel
Sorry for the late reply.
Yes. It is available inside the Sharepoint2010 Site. Herewith I've attached the Snapshot (zipped) of that control.

Re: How to get Hidden Ele(Not available in Screen display))

Posted: Fri Mar 18, 2011 2:18 pm
by Support Team
From your snapshot it is clear to me that invisible cells are not yet created by the application. The rows are there, but not the cells in them. Only the first two or three invisible rows also have cell elements in them.
I guess the grid creates the cells when you scroll to them.
And it seems that the grid control does not report its size correctly and that's why the EnsureVisible does not work on the first two or three invisible rows, since Ranorex thinks these rows are already visible (due to the wrong size of the grid).

Does EnsureVisible work if you invoke it on an invisible row further down?
As a workaround you can scroll down using the keyboard, i.e. generate a keyboard press on the "Down" button after reading one row.

Regards,
Alex
Ranorex Team