I have obtained a value, lets call it “myProperty” from the command line running mvn gatling test.
How can I use that value in a header definition?
Now the header is hardcoded like this
val headers_12 = Map(
“Accept” → “text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8”,
“Origin” → “https://utv2.kj.nhn.no”,
“Upgrade-Insecure-Requests” → “1”)
But i want o replace the “Origin” with “myProperty”
I assumed this could work, but it is a session-way of reffering values:
val headers_12 = Map(
“Accept” → “text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8”,
“Origin” → “${myProperty}”,
“Upgrade-Insecure-Requests” → “1”)
answering myself again, sorry:
val headers_12 = Map(
“Accept” → “text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8”,
“Origin” → myProperty,
“Upgrade-Insecure-Requests” → “1”)
worked 
But another question would be how to replace utv2 in this .exec with “myProperty”?
.exec(http(“Logg inn som HP”)
.get("/innlogging-webapp/mock/Innlogging/login?nin=${hpr}&resource_url=https%3A%2F%2Futv2.kj.nhn.no%2Fhpp-webapp")
Thinking in the lines of this:
.get("/innlogging-webapp/mock/Innlogging/login?nin=${hpr}&resource_url=https://"+myProperty+".kj.nhn.no/hpp-webapp")
but no luck…
I will stop asking question because I figure it out myself. The solution is:
.get("/innlogging-webapp/mock/Innlogging/login?nin=${hpr}&resource_url="+myProperty+"/hpp-webapp")