Forum Discussion
Does this help? https://support.smartbear.com/testcomplete/docs/testing-with/running/get-test-name.html
I have tried to work with that method also, but haven't been successful. The suggestions that TC gives doesn't offer the Parameters or Variables to be appended to Project.TestItems.Current.Name
When I try use something along those lines, it throws an Exception during runtime for either parameters or variables if you try to setup similar to this...
"Project.TestItems.Current.Name.Parameters.StationNumber"
Apparently, the Current.Name method doesn't extend to also allow for the use of the test's Parameters or Variables...
- Marsha_R10 months ago
Champion Level 3
The examples under Get Test Case Name will show you how to get the name. Then you can do something like this or whatever you need.
MyNewVariable = aqTestCase.CurrentTestCase.Name + "- " + MyParameterName
- scottroutesmart10 months agoContributor
For anyone else who is watching this thread and may want to do something similar in JScript, Marsha gave me enough info that I was able to put together this single line which can be used as the Code parameter I needed for the keyword test I am calling (from the top level test in my Execution Plan)...
eval(aqString.Concat(aqString.Replace(Project.TestItems.Current.ElementToBeRun.Caption, ' - ', '.'), '.Parameters.StationNumber')) + " - COPY"
I am sure that someone can probably come up with something more concise, but that was the best I could do in a short time using the functions I could find within the online documentation. If you have anything better, feel free to share.