I have searched the forums and documentation and can't find an easy way to reference the current keyword test variables using the "code" option. Something similar to the aqTestCaseObj.CurrentTestCase function, but would also extend to the parameters and variables contained within it.
KeywordTests.Current.Variables.OldName
or
KeywordTests.this.Variables.OldName
I am basically trying to store a value, then append something to it by referencing that variable. But, if I copy/paste into similar tests, I have to go in and manually edit each reference to the old test, and modify it to the new test name.
So, if my original test contains a reference to a variable in a parameter like this as code...
KeywordTests.TESTNAME1.Variables.OldName + "something"
When I copy it to the new tests I have to edit the test name manually to be:
KeywordTests.TESTNAME2.Variables.OldName + "something"
This is time consuming given all the dialog boxes involved in some places, and also error prone to typos, etc.
Reference the Current Keyword Test Variables
- Marsha_RModerator
Make the variables Project variables or Project Suite variables instead of having them local to a Keyword Test. Then you can reference them from any Keyword Test inside the Project or the Project Suite.
https://support.smartbear.com/testcomplete/docs/testing-with/variables/collections/index.html
Related Content
- 7 months ago