We tried to update the config property from test case using below command.
testExec.setStateValue(“counter”,tempcounter);
but it did not worked.
Is there any other way to do that??
We tried to update the config property from test case using below command.
testExec.setStateValue(“counter”,tempcounter);
but it did not worked.
Is there any other way to do that??
Hello ,
I have a very similar requirement. Trying to implement below scenario-
1. I have 25 test cases to be executed for which have one automated script.
2. I want to execute the same script in two different environment.
I want the script to toggle between the environments at run time without any manual efforts such that script should complete 25 test cases for environment 1 and then switch to environment 2 to repeat the execution .
Approach -
maintain two config files with same set of properties and names in each file for two environment . And then through java code make relevant config file active . So that script will refer to different config file for execution for every 25 test cases run.
Challenge - unable to find any inbuilt method to set config file active at run time .
can any one please suggest the method or code to toggle between multiple config files.
Also glad to discuss for any new approach for the same.
Thanks
Akshay
Hi Akshay
Please find the possible solutions below.
Sol1: use two command prompt steps to invoke tsRunner(headless LISA) with different config parameters.
Sol2:
Merge the two config files and pass it as a dataset to your Automation script. The script execute two times with different config properties. Excel dataset is also an alternate.
Hope this helps.
Thanks
Kundan Yalangi
Hi Kundan,
Thanks for the reply.
Could you please explain the second approach ,as I didn't get the merging of two config file.
Thanks
Akshay
Hello Akshay
Let me try to put this in detail. We will try to solve the problem with the Devtest out of box features.
Step1: Add a Do-Nothing step with "Load a Set of File Names Data Set" dataset attached. Please include your config files directory location in this dataset.
Step2: Add a step "Read Properties from a File " and refer the dataset name(which is config file name) from the Step1 and at this point the different config properties are loaded. The number of test iterations are based on the number of config files in the location mentioned in Step1.
Step3: Add your step over here.
Hope this helps. Feel free to ask any questions you have regarding this.
Note: If you want to prioritize the config files maintain the naming conventions such as config1,config2 etc.
Thanks
Kundan Yalangi
Hello Akshay
Let me try to put this in detail. We will try to solve the problem with the Devtest out of box features.
Step1: Add a Do-Nothing step with "Load a Set of File Names Data Set" dataset attached. Please include your config files directory location in this dataset.
Step2: Add a step "Read Properties from a File " and refer the dataset name(which is config file name) from the Step1 and at this point the different config properties are loaded. The number of test iterations are based on the number of config files in the location mentioned in Step1.
Step3: Add your step over here.
Hope this helps. Feel free to ask any questions you have regarding this.
Note: If you want to prioritize the config files maintain the naming conventions such as config1,config2 etc.
Thanks
Kundan Yalangi