Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error during execution of QTP script
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
if an error occur during execution of QTP script, how can i get the name of the current object that causes the error???
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
It will show up in the results file. In case you want to get the VBS error description you can use err object.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
thanks
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Ankur,
I found very interesting and helpfull tips here but this time it seems a little bit hard for me to find the answer on my own.
My scripts purpose is to fullfill a .xls file (OK/KO) while testing its values with those that appear on a website.

I have a "General run error" = 2147467259 when any of these 2 statements are executed :
1)
Code:
Chaine = cElements(0).GetROProperty("innertext")
with
Set wElement=Description.Create()
wElement("micclass").Value="WebElement"
wElement("class").Value="PSSRCHEDITBOXLABEL"
Set cElements=Browser().Page().PSFrame().ChildObjects(wElement)

2)
Code:
Chaine = cComps(n).GetROProperty("innertext")
with
Set cComp=Description.Create()
cComp("micclass").Value="WebElement"
cComp("class").Value="PSTEXT"
Set cComps=Browser().Page().PSFrame().ChildObjects(cComp)

The error seems to happen when about 9000 lines from my xls file are processed, which make me think to some kind of overflow/memory error.

Could you (or anyone here) help me with this ??
Thanks in advance
Alain
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
I have the same issue with ChildObjects on a web page. In some cases I found this helps:

Code:
wElement("class").RegularExpression = "false"

It seems some description objects use Regular Expressions to do the search, this turns it off and in the case of using "html tag" it does make the search for ChildObjects quicker and less error prone with there are a large number of objects.

However, it will still fail if there are x-thousands of objects. This occurs in QTP 9.5 and 10, so there is a limit to the number of objects it can handle. The only "work around" I can find is:

Code:
on error resume next
Set cComps=Browser().Page().PSFrame().ChildObjects(cComp)
if not isEmpty(cComps ) then
    'do something
else
    Reporter.ReportEvent micWarning, "cComps", "Returned Empty"
end if
on error goto 0

The error you are getting is because the variable is null/empty, I think. So you have to handle that and let your code continue. I just record the message and move on letting my devs no I can't test that many objects, usually a table, and they need to break it up if possible, or provide test data that doesn't fail.

Hope this helps.
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi There,
Thank you Mr knight for answering so quickly. I'll try to use your advice and will let you know asap if it has helped me.
Reply
#7
Solved: 11 Years, 3 Months, 3 Weeks ago
Actually, i couldn't get the programm to process more that 15.000 lines from my excel file before it get too slow. I'll have to launch the programm twice. I have far too much objects in my different collections.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to catch the script execution when QTP scripts are executed from command line Sreeni.lutukurthy 0 2,938 03-19-2015, 05:55 PM
Last Post: Sreeni.lutukurthy
  vb script to stop execution of functions if conditions fail visitjaga 1 7,380 12-05-2013, 12:26 AM
Last Post: ravi.gajul
  .vbs script error when trying to insert a value in a sapguitable frebuffi 5 6,835 07-18-2013, 03:04 PM
Last Post: Staff
  Speed issues on script execution (First Post) martinshort 4 3,287 07-03-2012, 03:02 PM
Last Post: martinshort
  Error while creating object using description.create object in VB script SarodeGirish 5 6,250 06-19-2012, 05:30 PM
Last Post: ssvali

Forum Jump:


Users browsing this thread: 1 Guest(s)