We tried to update the config property from test case using below command.
but it did not worked.
Is there any other way to do that??
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.
Can you please provide the DevTest version you are working with, the script, and the reason that made you think that this statement did not work? If you checked the property value in the properties pane after executing the script, did you execute a refresh on the properties?
It will update the propert temporarily but won't update the project.config file. You might need to write within config file using code.
This property value will be updated only in run-time when you execute the test.
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 .
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.
Please find the possible solutions below.
Sol1: use two command prompt steps to invoke tsRunner(headless LISA) with different config parameters.
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 for the reply.
Could you please explain the second approach ,as I didn't get the merging of two config file.
Retrieving data ...