search cancel

How to pass variables when using Using ANT test runner.

book

Article ID: 200618

calendar_today

Updated On:

Products

CA Cloud Test Mobile CA Application Test

Issue/Introduction

Need to pass variable information starting from outside of Lisa entirely, all the way into using it in a test, or suite of tests.

The development of the test systems is picking up pace, and there are multiple hosting environments coming online.  Must be able to programmatically pass which host to send the testing traffic to setup.

Currently, all of the tests are hardcoded with the development hostname, and now the tests need to be called with something like http://{{endpoint}}/blah/blah.

The pipeline that calls the Lisa tests suite does so with ANT.  Currently trying to pass an environment variable through the ANT call and use it in Lisa.  Need to know how this can be done. 

After reviewing this documentation: 

https://techdocs.broadcom.com/us/en/ca-enterprise-software/devops/devtest-solutions/10-5/using/using-application-test/using-devtest-workstation-with-application-test/building-test-cases/properties/property-sources.html

There is not a clear example using ANT via variable passing.

Environment

Release : 10.5

Component : CA Service Virtualization

Resolution

Had a look at it and was able to spot that a config variable needed a simple folder name prefix added to it.

The solution now looks something like this.

<target name='run-junit-suite' depends='clean' description='run a test suite' >

              <junitlisa lisahome='${env.LISA_HOME}' toDir='${report.dir}' printsummary='true'  showoutput='true' user='${env.LISA_USER}' password='${env.LISA_PASSWORD}' registry='${env.LISA_REGISTRY}' config='${basedir}/Configs/${env.LISA_CONFIG}'>

             <lisatest suite='${test.suite}'/>

              </junitlisa>

              <junitlisareport toDir='${report.dir}'/>

       </target>

 


The missing ingredient is that when specifying a config… It’s not the name as it appears in Lisa. It’s the full file path to the file.config as it exists on the file system.

So in the Lisa project folder there would be a Configs directory, and to use QA, set LISA_CONFIG=qa.config as an environment variable.