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

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
thangavel
Posts: 50
Joined: Tue Jun 09, 2009 6:48 am
Contact:

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

Post by thangavel » Wed Mar 09, 2011 3:50 pm

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)
Regards,
Thangavel.S

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

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

Post by Ciege » Wed Mar 09, 2011 6:02 pm

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

thangavel
Posts: 50
Joined: Tue Jun 09, 2009 6:48 am
Contact:

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

Post by thangavel » Thu Mar 10, 2011 7:55 am

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.
You do not have the required permissions to view the files attached to this post.
Regards,
Thangavel.S

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Thu Mar 10, 2011 12:38 pm

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

thangavel
Posts: 50
Joined: Tue Jun 09, 2009 6:48 am
Contact:

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

Post by thangavel » Fri Mar 18, 2011 8:31 am

Sorry for the late reply.
Yes. It is available inside the Sharepoint2010 Site. Herewith I've attached the Snapshot (zipped) of that control.
You do not have the required permissions to view the files attached to this post.
Regards,
Thangavel.S

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Fri Mar 18, 2011 2:18 pm

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