kbuu's avatar
Regular Visitor
2 years ago
New Idea

Be Able To Copy And Paste Variables

Sometimes Keyword Tests are similar enough where I would need to copy and paste variables from one test to another, but to do so is not possible on TestComplete.  Whenever this occurs, I would need to manually copy and input all of the variables from one test to another, which can be quite tedious if there are many variables and multiple tests to do this to.    


Considering that copying and pasting test steps is functional between Keyword Tests, I think it's reasonable to expected variables to be copied and pasted between the tests too.  


  • MW_Didata's avatar
    Regular Contributor

    Can't you just use project variables?

    And if between projects use Projectsuite variables?

  • kbuu's avatar
    Regular Visitor

    Sometimes the tests are similar enough that they use the same or similar variables, but are different enough that the variable values would be different, which is why project variables would not necessarily always work.  


    If copying steps of the the entirety of keywords tests from one keyword test to another works, I tend to think that it stands to reason that copying keyword test variables from one to another would also be the norm.

  • MW_Didata's avatar
    Regular Contributor

    thinking about it now I actually do this same thing sometimes, I would be nice to copy the variables over aswel

  • tristaanogre's avatar
    Esteemed Contributor

    I'm not sure why project variables would not work.  Basically, if this was script code we'd be talking about, I'd have variables that are scoped "global" in the script unit that are then available to all methods/functioins within the unit.  Project variable are just that... global scoped variables available for use by anything within the project.

    The reason why I don't think it's an issue to have two different test cases using the same variable but different values is precisely that:  two different test cases.  It's not like the variable needs to persist the value between the test cases, just that the variable is declared in a scope that the test case can get to it.

    So, set up project variable 1, use it in test case 1 with certain values you assign within the test case.  Then do the same with test case 2, and 3, etc.

  • Marsha_R's avatar
    Champion Level 3

    For the variable values that are different, you could also load them from a data sheet at the top of the test. Have test 1 use the first line in the sheet, etc.