Forum Discussion
- sindhu10Contributor
Hi All,
Is there a way to return the name of the current sub routine or function that is being run. It would be nice to enter into the log.
I am currently coding in JScript.
I assume there is no way to do it using Jscript but is there a TestComplete inbuilt function?Thanks,
sindhu
- NisHeraValued Contributor
Hi You can use test indicator
push text method here is example and more
(you to detect in run time..)
if you need any message in Log you may use
Log.message("what ever you like")
What exactly are you trying to achieve? there could be better solution if you describe your situation
- sindhu10Contributor
Thanks for the comments.
Trying to achieve :
Example :
Function Test()
{
Test1();
Test2();
}
I just want the logs in the form of folders like Test->Test1->Results
Test2->Results
this will help me in debugging which folder and which step goes wrong.
Please suggest.
Thanks,
sindhu
- shankar_rCommunity Hero
For that you have use Log.AppendFolder and Log.PopLogFolder option.
Sample code would be like below,
function testmycode(){ Log.AppendFolder("testmycode"); Test1(); Test2(); Log.PopLogFolder(); } function Test1(){ Log.AppendFolder("Test1"); Log.Message("This is just a test"); Log.Message("This is just a test1"); Log.Message("This is just a test2"); Log.PopLogFolder() } function Test2(){ Log.AppendFolder("Test1"); Log.Message("This is just a test"); Log.Message("This is just a test1"); Log.Message("This is just a test2"); Log.PopLogFolder() }
Output: