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
Community Hero

Re: get name of current test in log.error event

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
4 REPLIES 4
Community Hero

Re: get name of current test in log.error event

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
[Community Expert Group]
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
Extensions available
Super Contributor

Re: get name of current test in log.error event

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

Community Hero

Re: get name of current test in log.error event

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

Re: get name of current test in log.error event

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:
Watch the new interview