Forum Discussion
This does seem like too many steps. Could you put in some actual code that's working now along with a sample call?
- scottroutesmart3 months agoContributor
Here is a screenshot of what I am doing to show the setup on how the test is called: (I also do something similar to call some scripts too.)
You can see I have a keyword test which takes in 9 parameter values, in order to make a backup of the data I want to preserve. Note that the 7th parameter is a Code Expression, which refers to a variable specific to the test being executed in the test "CSA_Maint_Copy_CSA_and_Verify_Default_Values_Flow"The Keyword test which I am calling is a generic method which I reuse across many tests, so only the parameters values it receives change.
The problem is... when I copy (control-c) the step which calls the generic method, and paste it in to another test, I then have to manually update the test name from "CSA_Maint_Copy_CSA_and_Verify_Default_Values_Flow" to reflect the new test name that I have created (let's say "CSA_Maint_Copy_CSA_and_Verify_Employees_Flow"). If there was a "currenttest" or "this.test" reference that I could use instead of the test name, then it would save the manual editing of these parameters with each new test created.- Marsha_R3 months ago
Champion Level 3
Does this help? https://support.smartbear.com/testcomplete/docs/testing-with/running/get-test-name.html
- scottroutesmart3 months agoContributor
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...