I'm having a problem where my script is hanging up during run time. I call all my functions from a function library and my test only consists of function calls, so I cant see exactly what line of execution my script is on. Is there a way (Im assuming a possible command from the command line) so ask QTP what line its on during runtime?
02-18-2011, 01:46 AM (This post was last modified: 02-18-2011, 01:47 AM by jsknight1969.)
you can still load the function library in QTP and place a "breakpoint" on any line of the function to pause execution and use the debug or watch panels to see what information your test is working with.
You can also press F11 to execute the test instead of F5. Continue to press F11 for each line of code and it will follow execution into the library.
yeah, I know how to do that the issue is I'm working through a business workflow where this error occurs 45min into the test, and the function that its showing the error is in one of the biggest functions (~300 lines long). Any other ideas?
Ah. Best advice I can give for those situations is to create a log file and put a log entry every 10 or so lines. At least that way you can narrow it down to a few lines of code based on the last log entry. You can use the Reporter.ReportEvent command, but I don't know if QTP shows the results for you when the test stops. if it does, use that event to make "log" entries to see what executed last. Otherwise, use the FSO to create a text file on the hard drive and write log events to it.