Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recovery scenario function call setup
#1
Solved: 10 Years, 9 Months ago
Hi,
I need help setting up a recovery scenario for my login screen.
The qtp script is as follows:
Code:
SystemUtil.Run "iexplore.exe", url,"", "open"
With Browser("browser").Page("page")
.WebEdit("username").Set username
.WebEdit("password").SetSecure password
.WebButton("GO").Click
End With

Browser("browser_2").FlexApplication("portal").FlexButton("button").Check CheckPoint("buttoncheck")

Now, if I comment out .WebButton("GO").Click to replicate the error when the login fails and FlexButton("button") is not visible, I can see the error popup that QTP throws - "Cannot find the "button" object's parent "portal" ...." Run Error with 4 options: Stop, Retry, Skip, Debug.

I have set up a recovery scenario which identifies this popup and clicks on the skip button, then calls a function. it works fine upto this point.
In this function, I would like to capture the screenshot and close the browser. I get 'Unspecified Error' in this operation.

In my post recovery option, I have set it to 'Restart current test run'

The function looks like this:
Code:
Function LoginErrorRecovery(Object, Method, Arguments, retVal)
Browser("creationtime:=.*").close
msgbox "browser closed"
End Function

Is there a better way to deal with such situations? i am open to try out different approaches. Also, how can I utilize (Object, Method, Arguments, retVal) ?

please help. thanks in advance.
Reply
#2
Solved: 10 Years, 9 Months ago
This looks like a case of error handling and not exception handling.

For taking a screenshot you can use .CaptureBitmap method.

The various strings in brackets are simply the arguments that you pass to a function. Probably you can brush-up knowledge on the user defined functions in VBScript
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Framework along for HP Uft but not entire setup vayukumar 0 1,017 02-15-2018, 08:19 AM
Last Post: vayukumar
  Create Video of a scenario shivangshah 0 1,140 01-30-2017, 07:45 PM
Last Post: shivangshah
  Calling a function in a Test Script from a function library anupam4j 3 5,894 06-26-2015, 12:31 AM
Last Post: babu123
  Not able to call the function kathirvelnagaraj 1 2,467 01-06-2015, 07:24 PM
Last Post: kathirvelnagaraj
  Default recovery scenario TurtleRock 1 2,805 05-30-2014, 02:17 PM
Last Post: Tarik Sheth

Forum Jump:


Users browsing this thread: 1 Guest(s)