I am developing VBscript for GUI testing. And I wonder if there is possibilites to get the current Sub name.
I have divied the GUI testing into different Sub and want to log the Sub name to the logg file to track what is run.
So this i that I want
Sub TestCase1
Log.Message(SubName)
' Rest of test
End Sub
By using this I don’t have the sub name hardcoded as a text string
VBScript (unlike JScript) doesn’t provide any means to get the current routine name.
What you need is to run your script routines as test items (you’re using TestComplete, right?) — in this case you’ll get a tree-like log with messages grouped by script routines.
You’ll also be able to access the test items programmatically via the
Project.TestItemsobject. For example, you’ll be able to get the name of the current script routine that is run as a test item using theProject.TestItems.Current.ElementToBeRun.Captionproperty.