| || |
Getting the exact testcase name in runtime
Command to get name of TestCase: TName = getvar("testname");
I tried this for a test case.
Since we are running test cases from TD server the value returned by TName
"C:\\Documents and Settings\\chandan\\Local Settings\\Temporary Internet
Files\\TD_70i\\KASHI@@@@Korma\\Test\\First Name Field_32\\32\\First_Na"
Isn't there any way to get =just= the testcase name? e.g. First_Name_Field???
Thanks for your help.
Re: Getting the exact testcase name in runtime
If you want the last item in the path (file name), the following should work:
TName = getvar("testname");
fields = split(TName, myArray, "\\");
TName = myArray[fields];
If you want the 3rd from the last, just change the array index:
TName = myArray[fields - 2];
Hope that works/helps.
[i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)