If you have worked on QTP for some time you might have encountered errors like "General Run Error" which does not give any details regarding the error and testers often resort to using hit-and-try method to get the problem solved.
Instead, you can write a simple command to get the error number using err object. Just include this piece of code after the line where error occurred.
msgbox Err.NumberThis will throw the number code of the error. Now in all probability this error would not be documented in QTP's help VB Script Run time Error Reference. (Otherwise QTP would not have thrown it "General") Simply Google this error code and you can get the details and possibly how to resolve it.
If you want to keep track of further articles on QTP. I recommend you to subscribe via RSS Feed. You can also subscribe by Email and have new QTP articles sent directly to your inbox.
8 comments:
Hi all,
i used err.number for finding the error and i got the number as 5.iam not geting correct results for 5 when i searched in google.can any one tell me, how to search in google with that number
error -2147417851 , how to fix it??
one quick question ankur..
I intend to capture all the popup windows when rediff.com loads and close em immediately without interrupting the actual page load and rest of the steps in test.
when I tried recording http://www.rediff.com , on page load, it displays a pop -up window.I tried using pop-up trigger event at that point using recovery scenario manager. on recovery step I selected mouse/keyboard option and key operation "enter" as I don't know what action should be selected to close all the pop-up windows successfully and continue with the normal process of page load and clicking other options. in post recovery run step I chose "proceed to the next step".
when I try to run the script it give me error "general run error: " I captured the error number using Err.Number "-2147417851" and googled it.no help found on that?
can you please help me resolve this and guide me through the process how to capture pop-up window.
following is the statement where the error occurs: here Browser("Browser") changes to Browser("Browser_2").
Browser("Browser_2").Navigate "http://ia.rediff.com/uim/ads/Rediff_UShomepage-Popunder-640x480-Bottom3.htm","Bottom3"
Can u pls tel me how to google the error code....????
before google the error you can try this in watch in debug mode
DescribeResult(Err.Number)
I have written code to test if an url is entered , the web page is opened with the corresponding url. There are nearly 400 urls and I have coded for it. It is working fine for almost all except for 3 or 4 urls where I am seeing 'General Run error' dialog box. Because of this dialog box, the script is not running continuously without my personal intervention to click on 'Skip button' when the dialog box appears. I have to attend all the time the script is running , which takes nearly 3 hours. Can some one help me suggesting how to handle this situation.
The code is
Dim MyString, MyArray, Msg
MyString= oBrowse.Object.LocationURL
PageTitle = oBrowse.getroproperty("title")
which is working fine except for 3 or 4 urls. It is failing at the line MyString=oBrowse.Object.LocationURL
I am also facing the same problem, while executing the QTP script it is showing the same error message and tried to reinstall multiple times but there is no use.
And also run the batch file but there is no use.
Can anybody let me know the solution for the same
Thanks
Srinivas
I used InvokeApplication method to run my application and had got the "General run-time error" with err code -2147467259 or 0x80004005.
When I use Systemutil.Run the application was invoked without problems.
I googled the error code and found:
http://www.computerperformance.co.uk/Logon/code/code_80004005.htm
The described causes aren't suitable to my situation.
What cause is in my case?
@Alexander: The InvokeApplication statement is supported for backward compatibility only. QTP advise is to use SystemUtil.Run
Post a Comment