Ask a Question

How can I organize test logs in a tree grouped by added steps of the keyword test?

kakabubu
Contributor

How can I organize test logs in a tree grouped by added steps of the keyword test?

I want to group test logs like it shown on that video: https://www.youtube.com/watch?v=FuhWmeJ4_SI&feature=youtu.be&t=375

3 REPLIES 3
cunderw
Community Hero

Ha, that's from my webinar!

 

What you're looking for is the CreateFolder, PopFolder and PushFolder methods of the log object:

 

https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/createfolder....

 

https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/poplogfolder....

 

https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/pushlogfolder...

 

I actually created wrapper functions for this that provides a default styling and a single place to update / expand based on needs.

 

function indentLog(sDescription) {
  let oAttr = Log.CreateNewAttributes();
  oAttr.Bold = true;
  let step = Log.CreateFolder(sDescription, "", pmNormal, oAttr);
  Log.PushLogFolder(step);
}

function outdentLog(sExpected) {
  sExpected = sExpected ? sExpected : "Finished";
  Log.Message(sExpected);
  Log.PopLogFolder();
}

Thanks,
Carson

Click the Accept as Solution button if my answer has helped

Thank you! I'll gladly watch your webinar. It seems like your way to script tests is very like to the way I want to follow.

Feel free to send me a PM if you have any specific questions or want tips and tricks sir!


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
cancel
Showing results for 
Search instead for 
Did you mean: