cancel
Showing results for 
Search instead for 
Did you mean: 

Naming Each Iteration of a Test Item

Highlighted
Occasional Contributor

Naming Each Iteration of a Test Item

Hi,

 

I have a test item which is run multiple times using the Count option.

Is it possible to give each iteration a unique name in the test log?

 

Currently each iteration appears in the log as "TestItemName < Iteration N >".

I would like to be able to be able to assign each iteration a more meaningful name via scripting e.g.

"TestItemName < MyUniqueName>" or even better "MyUniqueName".

 

Any ideas on how to achieve this type of naming in the test log would be appreciated.

5 REPLIES 5
Highlighted
Community Hero

Re: Naming Each Iteration of a Test Item

If you are getting an iteration number in the log, then it sounds like you are already putting your own string to the log.  You can change that string to whatever you would like.

 

Look in your script for something like Log.Message and see if that's the case.

Highlighted
Occasional Contributor

Re: Naming Each Iteration of a Test Item

Thanks for your suggestion.

 

I haven't specified anything to be included in the log, the iteration number seems to be the default behaviour.

 

image.png

 

 

Highlighted
Community Hero

Re: Naming Each Iteration of a Test Item

Those log items are just a display of what happened. 

https://support.smartbear.com/testcomplete/docs/testing-with/log/viewing/pages/log-items-panel.html

 

 

You can only write to the Project Log that's displayed on the right.  This link will help with that:

https://support.smartbear.com/testcomplete/docs/keyword-testing/reference/logging/message.html

Highlighted
Occasional Contributor

Re: Naming Each Iteration of a Test Item

Thanks for your input.

 

I know how to write to the project log, but unfortunately that is not sufficient in this case. 

If there is no way to update the test item name, then I will have to rethink my approach to this problem.

Highlighted
Community Hero

Re: Naming Each Iteration of a Test Item

A suggestion:

 

Rather than using the "Count" property on the test item, add a for loop to your test case to loop through the 10 times.  Then use Log.AppendFolder and Log.PopFolder to build a tree structure in your test log to separate each time through the loop.  Log.AppendFolder has a text string parameter that you can use to title the "folder" that it creates so your log will reflect the 10 loops.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!
Top Kudoed Authors