Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Skip button using Script
#1
Not Solved
At the time of execution of script, i get an on error dialog box, so i need to navigate through it manually, Is there any way to automate that process as well, as per the condition, I want to navigate those errors automatically, by lookin at the error message i want to navigate
Reply
#2
Not Solved
use "on error resume next" statement. See QTP help for reference.
Reply
#3
Not Solved
But i dont want to skip all the errors, i just want to skip some particular message, can we not identify the text on the error dialog box
Reply
#4
Not Solved
you can put a simple if condition ..if that dialog box appears then perform the action.
Reply
#5
Not Solved
Yes sure you can just capture the message in the error dialog box if they are application related pop ups.

Use the code
Code:
strMsg=Browser("").Page("").Dialog("").GetRoProperty("PopupDialogText") 'get the txt displayed,chnge the objecthierarcrhy as per ur need.
if Instr(strMsg,"<Your Message that you want to chk>")>0 Then
  //your code to perform operation if the msg is as expected
End IF

Above code will work only for application related popups, if you want to work on the QTP error popup, u'll have to use On Error resume next statement. You can chk for the error number there as a condition.


Regards,
Ankesh
Reply
#6
Not Solved
Ok is that so, i was talking about QTP error pop up and not app based, popup, how can i check the number of the qtp based error window?
Reply
#7
Not Solved
You can use Err object to capture error number and error message
Please see the example below
Code:
On error resume next
systemutil.run "C:\flight.exe"
msgbox "Error Number :"&Err.number &vbcrlf & "Error Description:"& Err.Description

Regards,
Ravi
Reply
#8
Not Solved
But the question is, say der are two line of code
Line1
Line2

and in line 2 qtp throws an error
how can i skip those errors dat too depending on its desc.
Reply
#9
Not Solved
Could you please post your code.

Regards,
Sankalp
Reply
#10
Not Solved
Its a custome code for SAP in which its not able to find the Object or so, so QTP throws an error, am asking for such cases
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help for instruction to click on Skip button in the warning message vijilesh 0 1,505 09-16-2018, 03:48 PM
Last Post: vijilesh
  How to skip a For count? mv8167 2 2,501 10-23-2013, 07:06 PM
Last Post: mv8167
  How to skip an action newqtp 2 5,801 02-13-2013, 03:31 AM
Last Post: newqtp
  Press the Skip button on the dialog box mv8167 3 3,245 12-06-2011, 12:24 PM
Last Post: prasant
  How to skip the execution of Script lines in run time azeem 5 11,960 02-01-2010, 03:14 PM
Last Post: Saket

Forum Jump:


Users browsing this thread: 3 Guest(s)