cancel
Showing results for 
Search instead for 
Did you mean: 

Deploying Test Complete Automated Tests

Highlighted
New Contributor

RE: Deploying Test Complete Automated Tests

I'm also now fighting against local values that are stored after the first launch of my suite on a specific machine via test agent...



My configuration:



- Development machine with TestComplete

- Test Controller with TestExecute

- Test Agent and Test Execute 



Default values set and local values clear - after first launch of suite - local values are created from default values, than I need to have some local values wich will overwright with data from default values each time my suite is executed.



I thought If I will leave local values blank in my suite it will help me to solve this case - but nope, it overwrights local values only once on first run 😞 and then uses them without any clear way of how to change them.



P.S.: Local values settings file is not added to source control when adding suite to it, so I added it manually, but it doesn't help as well
Highlighted
Community Hero

RE: Deploying Test Complete Automated Tests

I have a similar issue just now. I have the full TestComplete (TC) IDE on my dev machine. We have integrated Test Execute (TE) into our build process which uses Team City. The TE instance exists on a networked VM. I have a global variable in my project setting which I use to switch between local and network mode, but I'm not able to set this via the command line. I can't use a stored global variable that is machine dependant as it also pulls down my TC script code from an online version control repository. So the project is always over-written before it is run. At the moment, we are relying on me remembering to set the gloabl variable before I push the project into the repository. I'd prefer if Team City was able to alter this variable at execution point. I suspect we'll need to look into running it via COM to get this though? Any further suggestions? (Oh, and apologies for this being all one long text. The <ENTER> key is not working in this reply box for me - in IE10 - I get an error in the console when I hit <ENTER> -


SCRIPT5007: Unable to get property 'toLowerCase' of undefined or null reference

ckeditor.js, line 31 character 1105


)
Highlighted
Community Hero

RE: Deploying Test Complete Automated Tests

Just to add, I have found a solution to this which works for me. I already had a global variable which determined whether I was running on my development machine or "somewhere else". I have now added a check which looks for a dummy folder on the PC that TC/TE is running on. If this folder is found, the flag is set to run local (the folder is created by me obviously ... and will not be present on any other PC/VM), if the folder is not found, the flag is set to network mode. Simple and effective.
Highlighted
Community Expert

RE: Deploying Test Complete Automated Tests


Hi, this might not be of much use but this is how we deal with Project Variables at work.


 


In order to provide as much flexibility as possible, except for during dev, our Projects do not contain any Project Variables, instead they are created from ini files at the discretion of the tests as they execute.


 


Each Project Variable is either:


1. A configuration setting


2. The name of a file which contains required data and it is the tests responsibility to process the data.


 


To facilitate this, we employ a standard pattern of having a setup and teardown for each test that initializes/purges Project variables as required.


 


This is acheived by using code similar to the following and having ini files in a common location across machines.


 


// Generic function for iterating through and processing an ini file


function processIniFile( fileName, optionProcessor ) {


  var iniFile, 


      option,


      optionName;


  if( aqFile.Exists( fileName ) ) {


    iniFile = Storages.INI( fileName );


    for( var i = 0; i < iniFile.SectionCount; i++ ){ 


      section = iniFile.GetSubSectionByIndex( i );


      for( var j = 0; j < section.OptionCount; j++ ) {


        optionName = section.GetOptionName( j );


        option = section.GetOptionByIndex( j, "Not Specified" );


        optionProcessor( optionName, option );


      }


    }


  } else {


    Log.Message( "File " + fileName + " does not exist" );


  }


}


 


// Create Project Variables from an ini file


function initializeProjectVariables( fileName ) {


  processIniFile(


    fileName,


    function( optionName, option ) {


        if( ! Project.Variables.VariableExists( optionName ) ) {


          Project.Variables.AddVariable( optionName, "String" );


        } else {


          Log.Warning( "Updating existing Project Variable " + optionName );


        }        


        Project.Variables.VariableByName( optionName ) = option;


    }


  ); 


}


 


// Remove Project Variables for options in an ini file


function purgeProjectVariables( fileName ) {


  processIniFile(


    fileName,


    function( optionName ) {


      if( Project.Variables.VariableExists( optionName ) ) {


        Project.Variables.RemoveVariable( optionName );


      } else {


        Log.Warning( "Could not remove Project Variable " + optionName + " as it did not exists" );


      }


    }


  );


}


 


function testInitialize() {


  var fileName = "C:\\Testing\\AMITestConfiguration.INI";


  initializeProjectVariables( fileName );


}


 


function testPurge() {


  var fileName = "C:\\Testing\\AMITestConfiguration.INI";


  purgeProjectVariables( fileName );


}


 


Regards,


Phil Baird

Highlighted
Contributor

RE: Deploying Test Complete Automated Tests

Is there any way to vote for a UI approach to configure each machine's variables?

DIstributed testing has been a kludge from the start, and I end up running the tests on the authoring machine, eating my time and leaving TE licenses unused.



I'm working out an XML approach that populates variables, but it seems weird that we have to create workarounds like that, and like the above, just to implement a feature that should have been there all along.
New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Let's start July with new challenges!

Create a script to pass custom command-line arguments as a test parameter for the TechCorner tag!

Will you dare to take the challenge?


Top Kudoed Authors