Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing parameters to recovery sceanrios
#1
Solved: 11 Years, 4 Months ago
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..
Reply
#2
Solved: 11 Years, 4 Months ago
Yes, you can pass parameters in a recovery scenario function.

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

Reply
#3
Solved: 11 Years, 4 Months ago
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
Reply
#4
Solved: 11 Years, 4 Months ago
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.

Reply
#5
Solved: 11 Years, 4 Months ago
Smile Ok...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Set data parameters Mik2s 1 1,481 03-07-2019, 10:18 PM
Last Post: supputuri
  Part of parameters missing when passing between actions skumar007 1 2,994 10-10-2014, 02:00 AM
Last Post: skumar007
  Launching .exe file with parameters magnifyingone 1 3,154 08-28-2014, 06:39 PM
Last Post: dplank
  Action Parameter passing problem Qtpuser1 1 2,833 04-18-2014, 06:23 AM
Last Post: kgovadav
  Need Help Understanding Parameters alex228015 0 2,285 03-18-2014, 12:30 AM
Last Post: alex228015

Forum Jump:


Users browsing this thread: 1 Guest(s)