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'

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328

3 Answers3

0

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

HgCoder
  • 1,243
  • 9
  • 14
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.

TheBlastOne
  • 4,291
  • 3
  • 38
  • 72
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.