09-15-2009, 08:33 PM
Hi,
I need help setting up a recovery scenario for my login screen.
The qtp script is as follows:
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:
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.
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.