cancel
Showing results for 
Search instead for 
Did you mean: 

get name of current test in log.error event

SOLVED
Highlighted
Super Contributor

get name of current test in log.error event

I cannot use Project.TestItems.Current to get the currently running test name because it is returning null in the Log.Error event. Is there a way to get the test name in code? Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Are you running from the project level with test items added to it? Sounds like you might running an individual keyword test or script function.


Thanks,
Carson

Click the Accept as Solution button if my answer has helped

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Project.TestItems.Current is the actual test item itself.  Replace with Project.TestItems.Current.Name and see if that gets you what you need.


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
Super Contributor

I cannot get the Name because the Current is null. I did use name....

Highlighted
Community Hero

Are you running from the project level with test items added to it? Sounds like you might running an individual keyword test or script function.


Thanks,
Carson

Click the Accept as Solution button if my answer has helped

View solution in original post

Highlighted
Super Contributor

Ohhhhhhhhhh. Yes I am. Dern, now I am thinking of the documentation I was reading when I found that info. Thanks.

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

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

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

Participate!

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

Participate!
Top Kudoed Authors