binithb
11 years agoOccasional Contributor
How to know the test function name, test file name and project name from a test complete function
Hi ,
We are trying to execute a test function and we need to know the name of the test function and the name of the current file from within the test function.
something like
function TestGlobalSearchClientContacts(){
var this_function_name = ??
var this_file_name = ??
.
.
.
testcode
}
How can we achieve this in Test Complete
We are using JScript and TC version is 9
Thanks,
Binith
We are trying to execute a test function and we need to know the name of the test function and the name of the current file from within the test function.
something like
function TestGlobalSearchClientContacts(){
var this_function_name = ??
var this_file_name = ??
.
.
.
testcode
}
How can we achieve this in Test Complete
We are using JScript and TC version is 9
Thanks,
Binith
Hi binith, as you are using JScript, you can extract the function name from the function arguments as described here. (you will need to scroll down a few posts to find the JScript examples)
As far as I am aware, however, there is no way to obtain the file or project name.
In the past, one the rare occasion I have wanted this information, I simply place the values in a global var in the Script Unit.
Regards,
Phil Baird