rjacobs007
14 years agoNew Contributor
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
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