- TanyaYatskovskaSmartBear Alumni (Retired)Status changed:Selected for DevelopmenttoImplemented
TestComplete 14.20 provides the CurrentTestCase property that returns information on the test case that is currently running. More information:
- Marsha_RModerator
We got it!
What's New in TestComplete 14.20
Applies to TestComplete 14.20, last modified on September 11, 2019 - Status changed:Selected for DevelopmenttoSelected for Development
Targetted for 14.20, September 2019.
- meinTestOccasional Contributor
For JavaScript, I found the following workaround. Maybe it will help others.
I create a try-catch block. Within the try I provoke an exception, this one I catch-up with the catch and read-out the function name in the stack.
Note: this also works across several units -> USEUNIT
function getCaller(){ let arrStackLines = []; try{ throw new Error("throw a error to get the stack"); }catch(objE){ arrStackLines = objE.stack.split("\n"); } let strLine = arrStackLines[arrStackLines.length -1]; let intStart = strLine.indexOf("at ") + 3; let intEnd = strLine.indexOf("(<"); Log.Message(strLine.substring(intStart, intEnd)); }
Best regards
meinTest GmbH
SmartBear preferred value-added Service
Provider in the DACH region
- sunilbabuOccasional Contributor
Any update on this?
- AerlockOccasional Contributor
Being able to reference the current test as an object would be helpful too. For example I am currently writing a bunch of new automation tests and find myself reusing several steps/tests with Code Expressions in them. These Code Expressions almost always reference the current Keyword Test using the KeywordTests.<TestName>.Variables.<Variable> format. Since I am copy/paste-ing these steps from test to test I frequently forget to go back and adjust my Code Expressions so I'll have one test trying to evaluate a value from a completely different test. Having a ThisTest.Variables.<Variable> object instead, so that when I copy/paste from one test to another I don't have to go in and fix it would be a BIG help.
- MKozinetsStaffStatus changed:New IdeatoSelected for Development
We will investigate if we can implement this suggestion in the upcoming release. We will update this thread with the results. Thank you.
- ekiza23Contributor
I would also suggest to get some 'call stack'; at least the direct caller of the current routine, and if possible N (or all) the call stack levels available.
- TanyaYatskovskaSmartBear Alumni (Retired)Status added:New Idea
- Marsha_RModerator
Hi Tanya -
- the name of the currently executed script routine;
- the name of the current script unit;
- the name of the current KDT test;
- the name of the current test item;
I would like all of those options! All of them can be useful in constructing an object name or logging messages. Tell R&D I don't want to pick just one. ;)
Related Content
- 9 years ago
- 7 years ago
- 9 years ago