Micro Focus QTP (UFT) Forums
Passing parameters to recovery sceanrios - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Passing parameters to recovery sceanrios (/Thread-Passing-parameters-to-recovery-sceanrios)



Passing parameters to recovery sceanrios - chanda Hemke - 06-02-2010

Hi

Is it possible to pass parameters in recovery sceanrios function as we pass in normal functions in QTP 9.2.
I want to pass my test case number and Excel file object to Recovery scenario function..and want to return the passed or failed status..


RE: Passing parameters to recovery sceanrios - Saket - 06-03-2010

Yes, you can pass parameters in a recovery scenario function.

inside function you can use reporter.reportevent to get the status.


RE: Passing parameters to recovery sceanrios - chanda Hemke - 06-03-2010

it would be good if u can provide me some sample code.recovery sceanio is for Pop up window....
here is my code...the frist one is my normal function..from where my recovery sceanio is triggered...during run when my script try to exceute "With SwfWindow("Main Frame: FA Terminal")" statement of first fucniton...it triggers the Recvoery scenario function (the second one) Function Recovery_MarginShortForClient(Object).

I want to pass dbConnectionOIObject, dbConnectionObject, testScenario_SequenceNumber, TestFailedScenariosSnapshotLocation to Recovery Function.....

Code:
Public Function OpenOrderEntrySell(dbConnectionOIObject, dbConnectionObject, testScenario_SequenceNumber, TestFailedScenariosSnapshotLocation)
   On Error Resume Next
    With SwfWindow("Main Frame: FA Terminal")
        .SwfToolbar("Menu_main Frame").WaitProperty "enabled", true, 1000
        .SwfToolbar("Menu_main Frame").Type MicF2
        With .SwfWindow("Win_FA Order Entry")
            .WaitProperty "Visible",True,10000
            If .Exist(5) Then
                OpenOrderEntrySell="Passed"
            Else
                 Dim Path_Failed_Snapshot    Path_Failed_Snapshot=TestFailedScenariosSnapshotLocation & testScenario_SequenceNumber&".png"
                SwfWindow("Main Frame: FA Terminal").CaptureBitmap Path_Failed_Snapshot,True
                Dim ReporterStatement
                ReporterStatement="Rerun - Can not open Sell Order form"
                Call UpdateActualExpectedValue(dbConnectionObject,  testScenario_SequenceNumber, ReporterStatement)
                OpenOrderEntrySell="Failed"
            End If
        End With
    End With
End Function


Function Recovery_MarginShortForClient(Object)
If StrComp(uCase(Arr(0)),uCase("Order rejected. Exposure not available. Margin short ")) =0 Then
        SwfWindow("Main Frame: FA Terminal").Dialog("Dialog_MarginShortMessage").Winbutton("OK").Click
    End If
End If
End Function



RE: Passing parameters to recovery sceanrios - Saket - 06-03-2010

very sorry for misleading, I just answered thinking of the parameters object, methods, arguments and retval which is for Test Run Error trigger.

Correction - No you will not be able to use any other parameters in recovery scenario functions.


RE: Passing parameters to recovery sceanrios - chanda Hemke - 06-03-2010

Smile Ok...