Finding a value of a property

Class library usage, coding and language questions.
KenBobPDX
Posts: 6
Joined: Tue Feb 24, 2015 5:30 pm

Finding a value of a property

Post by KenBobPDX » Mon Sep 28, 2015 11:34 pm

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!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3938
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Finding a value of a property

Post by odklizec » Tue Sep 29, 2015 7:36 am

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

KenBobPDX
Posts: 6
Joined: Tue Feb 24, 2015 5:30 pm

Re: Finding a value of a property

Post by KenBobPDX » Tue Sep 29, 2015 5:34 pm

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
Attachments
ReportAndAnalyzeSnapshot.rxsnp
(883.57 KiB) Downloaded 64 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3938
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Finding a value of a property

Post by odklizec » Wed Sep 30, 2015 7:46 am

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
TabPage.png (51.47 KiB) Viewed 720 times
So the only thing that probably changes (after clicking different tab button) is the content of the page from above xpath.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration