Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pause script with code
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
Have you looked PopUp method of shell object...
Code:
Shell=CreateObject("Wscript.Shell")
iMessageType = 0
Select Case sStatus
            Case "Fail"
                iMessageType = 16
            Case "Warning"
                iMessageType = 48
            Case Else
                iMessageType = 64
End Select
iResult = Shell.PopUp(sMessage , 5 , "Your message ", iMessageType)
'press the OK button to pause the script.
If iResult = 1 Then
   'paused then vbscript message box
MsgBox sOriginalMessage & vbCrLf & vbCrLf & "Automation Paused - Press OK to continue", , "Script Paused By User"
end if

Hope you will be able to modify / add the logic according to your need..
I donot have qtp rightnow.. Recovery Scenario(if activated see Recovery.Activate ) is somewhat like a a polling mechansim waiting for a signal( for example: OnError, as highlighted in above post) , once it catches the signal it executes the chosen action by the user ( a function call in this case) , hope post revoery , Continue to Next Step should work in your case... , however I am not sure if you would be able to correct the error in your qtp resources during this pause.. but definitely you can find what the error was ... DescribeError statement will prob bring the last error in qtp.. or we can use for Err.Source, Err.Number and Err.Description and log these using the your logging function...Try Using these Error statements in Information bar/Debug View during this pause...

Note: As a best practice we use RecoveryScenario to handle unknown errors, however if you know that a statement is likely to cause an error then use On Error Resume Next and don not forget to put On Error goto 0 after catching the Err.Number and Err.Description

Best Regards,
Jiten
Reply


Messages In This Thread
Pause script with code - by JRDew - 03-04-2011, 12:27 AM
RE: Pause script with code - by oleg8888 - 03-04-2011, 04:06 AM
RE: Pause script with code - by JRDew - 03-04-2011, 06:20 PM
RE: Pause script with code - by tdevick - 03-07-2011, 10:16 PM
RE: Pause script with code - by JRDew - 03-08-2011, 02:03 AM
RE: Pause script with code - by tdevick - 03-08-2011, 09:46 PM
RE: Pause script with code - by aardvax - 03-08-2011, 07:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  VB script Code. Tejas Tikhe 2 3,658 06-19-2012, 10:54 AM
Last Post: Tejas Tikhe
Rolleyes How to pause QTP script using DotNet Factory nistalaramesh 3 5,184 06-23-2011, 02:59 PM
Last Post: Saket
  Pause from QTP. logeshkumarvb 2 4,439 01-11-2011, 07:20 PM
Last Post: UFTEnthusiast
  need script to pause the test kumsweta 1 3,444 12-02-2008, 09:26 PM
Last Post: roxer

Forum Jump:


Users browsing this thread: 1 Guest(s)