Micro Focus QTP (UFT) Forums

Full Version: General run error when Exist fails
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.