Micro Focus QTP (UFT) Forums
Current Line in Execution - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Current Line in Execution (/Thread-Current-Line-in-Execution)



Current Line in Execution - J112910f - 02-18-2011

Hey guys,

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?

Thanks


RE: Current Line in Execution - jsknight1969 - 02-18-2011

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.

hope this helps.


RE: Current Line in Execution - J112910f - 02-18-2011

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?


RE: Current Line in Execution - jsknight1969 - 02-18-2011

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.




RE: Current Line in Execution - J112910f - 02-18-2011

Ok got it, so how do I create a txt file that logs everything using the FSO?


RE: Current Line in Execution - basanth27 - 02-23-2011

Why not use msgbox in the function file and then use watch to find the variation in your variables?


RE: Current Line in Execution - Anand - 05-17-2011

Please find the file "Scripting QTP -Working with Files.pdf" it will help you to create edit and delete the files/folders


J112910f hope u got the file "Scripting QTP -Working with Files.pdf"


RE: Current Line in Execution - Anand - 05-18-2011

You can also log the timings in log file to see the difference