Forum Discussion

pmiley123's avatar
pmiley123
Occasional Contributor
13 years ago

Running the same script on multiple processes.

Hello,



I'm running a script on a QA version of a product and would like to run the same script on the beta and production version as well.  The only thing I need to have change is the process name. So, instead of creating multiple scripts with Call Alias.QA. / Alias.Beta / Alias.Prod, I would just have a one script with a changing process name.  



I tried setting the process name as a project variable and changing the variables value to the process I am running (i.e. Alias.ProjectVar), but I get the error "Variable not defined" even though it is defined.  Also, I tried to set a mapped object name to multiple objects but this is not allowed.  Any ideas on how to accomplish this?



Thank you.

3 Replies

  • Hi,


    You can map the process using a conditional mapping criterion that specifies several possible values for the varying identification property (the name of the process), so the mapped process will be correctly identified in either case.


    Please see the Using Conditional Mapping Criteria topic for detailed information.


    I hope this helps

    Ann

  • pmiley123's avatar
    pmiley123
    Occasional Contributor
    Thank you for the response.  I got the conditional name mapping to work but would still like to do accomplish this through a function so I can run one script on many process that may not be mapped. 



    Is there a way in Test Complete (using VBScript) to set a container object while changing the project name? 



    For example, this is the code I came up with but it won't compile:

    '--------------------------------------------


    function SetContainer(windowName)

    Dim container



    Set container = Aliases. + Project.Variables.processName + "." + windowName   'error here

    SetContainer = container

    end function