Micro Focus QTP (UFT) Forums

Full Version: ERROR : Object reference not set to an instance of an object.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all ,

I am facing a issue while automating a WPF app on Windows

I added Plugin "WPF" as needed and added WEB , ActiveX and Vbscripts as plugin while Opening QTP app

while recording it recorded Properly but on rerun it gets failed with below error


ERROR :-
Object reference not set to an instance of an object.
Line (13): "WpfWindow("MYAPP1").WpfButton("OK").Click".

so I tried debuging

i code like

Code:
Dim Varname
Varname  = WpfWindow("MYAPP1").WpfButton("OK").GetROProperty("text")
msgbox(Varname)

WpfWindow("MYAPP1").WpfButton("OK").Click

Varname Message Box shows "OK" , so it means object is Recognizes. - BUT IT FAILS IN NEXT LINE
I checked Obj repository and checked OK button is there !!!


also tried

Code:
Set WinObject = WpfWindow("MYAPP1").WpfButton("OK")
If  WinObject.Exist Then
            msgbox("yes")
    else
        msgbox("NO")
End If

It gives error as -
General run error.
Line (9): "Set WinObject = WpfWindow("MYAPP1").WpfButton("OK")".

FUNNEST Part is , i DOONO Some times both above code works and "OK" Button get pressed !!! Smile

I don't want to Use Descriptive programming as get all Child Objects , loop and get the Object which is required
Hi,
With description programming is the same?
Hi All,
Is there any solution for this issue ??