Micro Focus QTP (UFT) Forums
General run error when Exist fails - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: General run error when Exist fails (/Thread-General-run-error-when-Exist-fails)



General run error when Exist fails - msacks - 02-08-2019

I'm running a script that includes this code:

    If SAPGuiSession("SAPGuiSession").SAPGuiWindow("Person 1 Entry").Exist(1) Then
        ...
    Else
        ...
   End If

When the object exists, there is no problem, but when it does not (and that's supposed to happen on some occasions, going to the Else clause), I get a general run error.

I tried looking at the error with a MsgBox. The error code is -2147417851.


I'm running UFT version 14.51 build 1566 on a Windows 7 machine.

Thanks for your help.


RE: General run error when Exist fails - Ankur - 02-08-2019

It would help if you can paste the code that goes inside else block.

Also check at what statement in else block UFT throws the error.