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.Number
This 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.
This error indicates that the sqlite3 database file is either not readable or not writable by the user running Ghost.
Hi All,
I am getting “-2147220983 ” while executing the below code to maximize the IE.
Could you please suggest a way to overcome the issue.
SystemUtil.Run “iexplore.exe”,”http://hpqc:7011/qcbin/” ,””, “”, 1
Dim hWnd
hwnd=Browser(“HP ALM – Quality Center”).GetROProperty(“hwnd”)
hWnd = Browser(“hwnd:=” & hWnd).Object.hWnd
Window(“hwnd:=” & hWnd).Activate
Window(“hwnd:=” & hWnd).Maximize
Thanks &Regards ,
Srinivas G
DataTable.AddSheet "TestCases"
DataTable.ImportSheet "C:\Documents and Settings\seema\Desktop\TestDataOR.xls","Global","TestCases"
Function FindObject(ObjectName)
For StepNumber=1 to DataTable.GetSheet("TestCases").GetRowCount
DataTable.GetSheet("TestCases").SetCurrentRow(StepNumber)
If ObjectName=DataTable("ObjectName","TestCases") Then
Set Desc=Description.Create
If DataTable("micclass","TestCases")"" Then
Desc("micclass").value=DataTable("micclass","TestCases")
End If
If DataTable("htmlid","TestCases")"" Then
Desc("html id").value=DataTable("htmlid","TestCases")
End If
Set obj=Browser("creationtime:=0").page("title:=.*").ChildObjects(Desc)
Set FindObject=obj(0)
End If
Next
End Function
FindObject("EmailEditBox").Set "ckseema.it@gmail.com"
FindObject("PasswordEditBox").Set "goodluck"
here i am getting general run error how can i solve this…
Can anyone tell me what is this QTP Run Time error -2147467259.
Thanks,
I get the same error while trying to execute the following part of code:
Set Productcolor = Description.Create
Productcolor(“micclass”).value = “Image”
Productcolor(“html tag”).value = “IMG”
Productcolor(“image type”).value = “Plain Image”
Set Colorcollection = objPage.ChildObjects(Productcolor)
NumberOfcolors = Colorcollection.Count
objBrowser.Sync
msgbox ” Total Colors is” & NumberOfcolors ‘displays number of products in msg
‘——–Randomly clicks and selects a color——
If Numberofcolors = 0 then ‘Does not select color if only one color is available
Else
Randomize
Anycolors=RandomNumber(1,NumberOfcolors)
Colorcollection(Anycolors).Click
msgbox Err.Number
End If
Hi Ankur,
When I give DescribeResult(err.number) in watch to get error number, it is showing value as ‘Unspecified Error’.
How can I get the error?. Please help.
Thanks,
Hi Ankur,
I have a very strange problem with QTP.
I am getting General Run Time error (at specific line of code everytime) when I run the script in a Virtual Machine with windows 7 and IE8. Please note that the script works fine, but in the run results viewer, it shows as Failed at certain line of code.
And when I run the same script in a different VM with windows xp and IE8, it works fine and also shows as Pass in Run Results.
I am unable to get what could be the issue.
Please help as I am in serious situation. Thanks.
I have a scenario.I opened 4 yahoo mail pages.I need to count how many browsers are opened and i need to close all yahoo mail browsers ONE BY ONE.
FOR THAT I DEVELOPE THE CODE LIKE FOLLOWING
Set x=description.create
x(“micclass”).value=”Browser”
Set br=Desktop.ChildObjects(x)
For i=0 to br.count-1
br_name=br(i).getroproperty(“title”)
msgbox err.number
If br_name=”Yahoo! Mail: The best web-based email! – Microsoft Internet Explorer” Then
br(i).close
End If
next
@souravigb please resolve my issue.i hope u faced the same issue.
pleae help me out.
Hello Ankur and everyone,
It seems that noone has came to this site after I posted my problem.
However, I got my solution with R&D. What I did is, I started my script keeping in mind that more then one browser might be open.So did the coding in that way and I failed.
THis time, I used a bit shortcut. Closed all window and left gmail open. Now I used the code below and I am able to fetch the fifth new email which is my target.
Set mybrowser=description.Create
mybrowser(“micclass”).value=”Browser”
Set mywinobject=description.Create
mywinobject(“micclass”).value=”WebElement”
mywinobject(“class”).value=”zF”
mywinobject(“html tag”).value=”SPAN”
‘mywinobject(“class”).value=”post-body”
Set winchild=Browser(“micclass:=Browser”).Page(“micclass:=Page”).ChildObjects(mywinobject)
msgbox winchild.count
For i=0 to winchild.count-1
x= winchild(i).getroproperty(“innertext”)
PRINT x
If i=4 Then
winchild(i).click
End If
Next
Thanks for all the previous comments. I will post my queris again if I get in trouble.
Take care,
Sourav Bose
Hello,
In the above code a bit changes is there. Here I was not only counting the number of emails but also wants to get the value in the outertext of the webelement property.
Thanks,
Sourav
Hi All, I have gone through the comments but there is no satisfactory answer and am still having the problem. Though my question is mainly to Ankur but I will be obliged if anyone can try this and give me a solution.
I am using Descriptive programing.Purpose of the script is to
1. count all the emails visible on the first page of Gmail inbox.
2. Once counted, click on the 5 email to view its content.
Now, I am having problem in first phase.
I have writing the script which everyone can run in qtp to check the exact error:
Set obj_browser=description.Create
obj_browser(“micclass”).value=”Browser”
Set obj_desktop=desktop.ChildObjects(obj_browser)
cnt=obj_desktop.count
msgbox cnt
For i=0 to cnt-1
x=obj_desktop(i).getroproperty(“title”)
msgbox x
If x=”Gmail” Then
set obj_webelement=description.create
obj_webelement(“micclass”).value=”WebElement”
obj_webelement(“html tag”).value=”SPAN”
obj_webelement(“height”).value=”16″
obj_webelement(“class”).value=”zF”
obj_webelement(“outerhtml”).regularExpression=false
set obj_webcnt=Browser(“micclass:=Browser”).Page(“micclass:=Page”).ChildObjects(obj_webelement)
msgbox err.number &”——-” & err.description
cnt1=obj_webcnt.count
msgbox cnt1
For j=0 to 2
x=obj_webcnt(j).getroproperty(“outertext”)
msgbox err.number &”——-” & err.description
msgbox x
Next
End If
Next
Set obj_browser=nothing
Set obj_webcnt=nothing
Set obj_webelement=nothing
once i run this program, you can also see that the error which we get is::-2147467259 general run error
please short this problem asap.
my email id is souravigb@gmail.com
thanks to all in advance.
Hi Ankur,
this is srinivas,i have a small doubt in qtp, that is
1) What is the difference between recovery scenarios and error handling, when we can use recovery scenarios and error handing?
2) i saw in your recovery scenraio’s extension is ‘.rs’,i think recovey scenario extension is qrs, may i know what is the exact extension for the recovery scenarios.
please send me the ans asap
my mail id is :
vasuth2008@gmail.com
Thanks & Regards
Srinivasulu.T
Q.A Team
Patni
Hi all,
Err.Description in QTP would help in getting the error description.Please try and let us know
@Alexander: The InvokeApplication statement is supported for backward compatibility only. QTP advise is to use SystemUtil.Run
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?
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 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
before google the error you can try this in watch in debug mode
DescribeResult(Err.Number)
Can u pls tel me how to google the error code….????
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-640×480-Bottom3.htm”,”Bottom3″
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