Forum Discussion

rjacobs007's avatar
rjacobs007
New Contributor
14 years ago

Unit name in a variable

Hi,



Is it possible to get the unit name in a variable? I know about the following:

Sub Tester

  Dim Tests, TestItem, Test

  ' Obtains the project’s test items

  Set Tests = Project.TestItems

  ' Obtains the test item which is currently running

  Set TestItem = Tests.Current

  ' Obtains the test executed by the test item

  Set Test = TestItem.ElementToBeRun

  ' Posts the name of the executed test to the log

  Log.Message("The " & Test.Caption & " test is being executed.")

End Sub



but that requires you to run from the organize test area, which I am not doing. Is there another way to get the Unit name in a variable?



Thanks,

Ronald

1 Reply

  • Hi,



    There's no way to get the name of the current unit. I've increased the appropriate suggestion's rating in our DB.