Page 1 of 1

Finding a value of a property

Posted: Mon Sep 28, 2015 11:34 pm
by KenBobPDX
How do I get to the value of a custom property on a TabPage control? Is there a way to get the control associated with the TabPage, so I can interrogate the underlying control for the property? I've tried creating a control using Ranorex.Control.FromElement(tabPage.Element), but that threw an exception. I've tried calling tabPage.FindChildren<Ranorex.Control>(), but that just returns an empty list. The hope was if I were to get to the Ranorex.Control, I could use the method GetPropertyValue<string>("InternalAutomationID"); to get to my custom property, but I can't seem to be able to get to the control. Any help would be appreciated. Thanks!

Re: Finding a value of a property

Posted: Tue Sep 29, 2015 7:36 am
by odklizec
Hi,

Please post a Ranorex snapshot of the element in question. It's very hard to suggest something reliable without snapshot. Also, do you see the property (and its value) you are looking for in Spy? If not, then you may be out of luck to read the value. But again, it's very hard to say something definitive without examining the snapshot.

Re: Finding a value of a property

Posted: Tue Sep 29, 2015 5:34 pm
by KenBobPDX
Here you go. I just want to get to a property on the underlying control. I can't seem to be able to get beyond the Ranorex.TabPage control and its various properties. I need to get to my control that sits just underneath the Ranorex.TabPage control.

Thanks in advance.

Ken

Re: Finding a value of a property

Posted: Wed Sep 30, 2015 7:46 am
by odklizec
Hi,

Thanks for the snapshot. Unfortunately, I'm still not quite sure what exactly you want to do? ;) What kind of custom property you want to get and from where? Could you please post the xpath of element, from which you want to get its "custom property"? I see the Tab controls, but from where exactly you want to get the property you are talking about?

BTW, if you want to get the content of container associated with each Tab button, then I'm afraid, there is just one container, which dynamically changes its content based of the selected Tab button. In other words, no matter which Tab button is selected, the path to container is still the same.
/form[@controlname='Portal']//container[@controlname='viewerPanel']//container[@controlname='ViewerControl' and @caption='' and @controltypename='ViewerControl' and @instance='1']//container[@caption='' and @controltypename='WebBrowserControl']//container[@controlname='splitContainerBrowser']//container/dom/body/div/table/tbody/tr/td
And this path points to the big pinkish area in below screenshot...
TabPage.png
So the only thing that probably changes (after clicking different tab button) is the content of the page from above xpath.