Hi,
I am running a script to run my test through Command Line. I have a variable called logins (file) type which is .csv. I read my logins and passwords through it.
Is there way I can parameterize my file name value, so that I can change the file when running the script?
Script:
./NeoLoadCmd -project pathToMyProject.nlp
-launch Scenario1 -noGUI -variables env=PROD, logins=variables/LoginCredentials.csv
I am hoping to change logins value to something else next time I run this script. For example change the logins variable value to = LoginCredentials22.csv. Can I do that?
I recommend you rename the variable "Logins" to "Logins_Prod".
Then, you need to declare an "ENV" constant variable, which value is "Prod" or "Stage" according to the context (you can override in the command line with -variables ENV=Stage
Then you can use:
{"@action":"login","@class":"login","@username":"${logins_${ENV}}.username","@psw":"${logins_${ENV}}.password"}
You cannot variabilize the file path. You need to variabilize the calls:
Declare one variable per Environment:
MyFileFor-PROD=LoginCredentials-for-PROD.csv.
MyFileFor-PREPROD=LoginCredentials-for-PREPROD.csv.
then, variabilize all calls:
Login parameter = ${MyFileFor-${ENV}}.Login
Christophe,
So I declared two variables:
Variable 1: "Logins" contains file loginsProd.csv
Variable 2: "Logins_Stage" contains file loginsStage.csv
Question: How do I run a script in CMD, so I can choose either Variable 1 or Variable 2 for all my login calls in the project?
My current call looks like this:
{"@action":"login","@class":"login","@username":"${loginsProd.username}","@psw":"${loginsProd.password}"}
christophe was made best respondent
christophe was made best respondent
christophe answered
Shahboz answered
christophe answered
Shahboz posted a new question
Shahboz posted a new question