vlatko606
vlatko606

Reputation: 1149

Jmeter - Reading data from 'user.properties' into 'user defined variables'

I am trying to use data from user.properties file. The data is defined like: protocol=https

I tried to use into 'user defined variables' like:

enter image description here

prop ${__P(protocol)}

When i call as: log.warn("Whole1: " + vars.get("prop"));

the result is always: 1

What should i do in order to get value as 'https'?

Upvotes: 1

Views: 2756

Answers (2)

Dmitri T
Dmitri T

Reputation: 168197

Most probably you have previously set the protocol property to be 1 hence you're getting that value as properties live as long as JVM lives, remember that you need to restart JMeter each time you make a change in the user.properties file, apart from this your syntax looks good.

You can also use -J command-line argument in order to override the JMeter property value like:

jmeter -Jprotocol=https 

More information:

Upvotes: 3

sunny_teo
sunny_teo

Reputation: 1999

Try like this ${prop}

Since, you are putting in UDV.

Upvotes: 0

Related Questions