0

I'm using following script for Recovery scenario in UFT by calling the function ErrorrecoveryHandler(object):

Function getClipBoardText(object)
    Dim objCB
    Set objCB = CreateObject("Mercury.Clipboard")
    Dim sClipText
    ' Assign clipboard contents to string variable sClipText.
    sClipText = objCB.GetText
    'getClipBoardText = sClipText
    Reporter.ReportEvent micFail, "There was an exception during execution", sClipText
End Function

Function ErrorrecoveryHandler(object)
    JavaWindow("LightSpeedEVoMain").JavaDialog("Error").JavaButton("Copy to Clipboard").Click
    Dim objCB
    Set objCB = CreateObject("Mercury.Clipboard")
    errorDetails = objCB.GetText
    Reporter.ReportEvent micFail, "There was an exception during execution", errorDetails
    JavaWindow("LightSpeedEVoMain").JavaDialog("Error").JavaButton("OK").Click
End Function

When I run my application on a VM through ALM and there is an error, the above function call is triggred, but I'm getting an error:

Run Error:
ActiveX component can't create object: 'Mercury.Clipboard'

3 Answers 3

0

That ActiveX object should be registered as part of the base QTP/UFT install. You may want to try re-installing.

0

As outlined in for example http://www.sqaforums.com/showflat.php?Number=203008, Mercury.Clipboard is available only if you install QTPPlus.

Without it, there is no ClipboardObject.dll, which is the DLL that implements Mercury.Clipboard.

0

Strange but true: if you install UFT including the 'Flight' example project, you will also install the ActiveX component. Then you will have no problem using the Mecury Clipboard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.