Ask a Question

Error in step that has a function call

smskrishna
Occasional Contributor

Error in step that has a function call

Hi,



I am currently using TestComplete 6.5 , I have written reusable functions in different units and using them in testcases when ever required. Some times I have to use the same function many times(with different data) in a single testcase . As part of my test execution I will pass random data(some invalid data also) to the function ,so after execution I will get the error messages in the result log .When I double click on the the errr messgae in the log, the testcomplete is taking me to the function which is causing the error rather than navigating to the step where function is called. Is there any option to be set to navigate to test but not to function where the error occured. If this option is not present I would suggest to provide the option of navigating to test step fro the result log, then tester can decide whether to visit the function are can change the value passed to the function. This would redue the debugging time especially while dealing test case that has huge number more test steps anf function calls. Also I would suggest line numbers to be displayed next to message in the result log which again will help tester to directly go to the respective line.



Please let me know if these options already existing in testcomplete, If not I hope you will consider my suggestions
Siva Krishna S M
3 REPLIES 3
ChrisH
Occasional Contributor

RE: Error in step that has a function call

You could try wrapping your function call inside a log folder.  The error message from within that function call would tell you what went wrong, but to navigate to the originating function you'd double-click on the log folder in the log rather than on the actual error message, if you see what I mean.



JScript:



Log.Append("Test case 1...");

OtherFunction(data);

Log.PopLogFolder();



Log messages in "OtherFunction" will be grouped together.  If you double-click the "Test case 1..." item in the log it takes you back to the code above, rather than the bit inside "OtherFunction" where the error occurred.
AlexKaras
Community Hero

RE: Error in step that has a function call

Hi Siva,



Doesn't Call Stack functionality of the log pane meets your needs? (See the "Call Stack Panel" help topic for more details.)
Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Pavel_1
Contributor

RE: Error in step that has a function call

Hi,


You can view the information you need in "Call stack" panel of the log. It shows the list of function calls and the line# where the problem occured. You can simply double-click the necessay function there and you'll be directed to appropriate line.

cancel
Showing results for 
Search instead for 
Did you mean: