Forum Discussion

vthomeschoolmom's avatar
vthomeschoolmom
Super Contributor
6 years ago
Solved

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

  • cunderw's avatar
    cunderw
    6 years ago

    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.

4 Replies

  • tristaanogre's avatar
    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.

    • vthomeschoolmom's avatar
      vthomeschoolmom
      Super Contributor

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

      • cunderw's avatar
        cunderw
        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.