Ask a Question

get name of current test in log.error event

SOLVED
vthomeschoolmom
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

4 REPLIES 4
tristaanogre
Esteemed Contributor

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

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

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

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

cancel
Showing results for 
Search instead for 
Did you mean: