Micro Focus QTP (UFT) Forums
Cannot retrieve Native property - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Cannot retrieve Native property (/Thread-Cannot-retrieve-Native-property)



Cannot retrieve Native property - JeL - 07-26-2019

Hi,

WpfObject. Using Spy the only valid option for object identification I see seem to be 
Native Property
Header {Value Defined}

To get this value i use this code:

Set oDesc=Description.Create()
oDesc("classname").Value="DevComponents\.WpfDock\.DockWindow" 
Set linkCollection=WpfWindow("WindowName").WpfObject("devname:=DockWindowGroup").ChildObjects(oDesc) 
For i=0 to linkCollection.Count-1
'  1)  nativePropertyVal = linkCollection(i).Object.Header 'Use the native property in place 
  
  set nativePropertyVal = linkCollection(i).Object
    nativePropertyVal.GetValue("Header")
   
    msgbox nativePropertyVal.GetValue("Header")

Next



However instead of getting value that spy show, I always get {null}.

Can you advise if any additional setup required to get Native property or am I doing something wrong?


RE: Cannot retrieve Native property - JeL - 07-29-2019

Resolved by adding ToString when requesting native property
nativePropertyVal = tabCollection(i).Object.Header.ToString() 'Use the native property in place