1

I have a JMeter script where I've defined some variables using the config element "User Defined Variables"

enter image description here

and locally when I use ${host} for instance in a request it works fine. I uploaded this script to Blazemeter and enabled overriding of properties:

enter image description here

However when I run the test in Blazemeter the new host value is not being replaced at all. Am I doing something wrong here or am I misreading how this feature is supposed to work in Blazemeter?

so cal cheesehead
  • 2,515
  • 4
  • 29
  • 50

2 Answers2

2

When you define the variables in the User Defined Variable components, you can access them with ${VariableName} as they act as JMeter variables.

When you define variables in Blazemeter they act as JMeter properties. You can access the JMeter properties with ${__P(PropertyName,)}. You cannot use ${VariableName} to access the. JMeter properties.

e.g ${__P(host,)} in your case

You can continue to use the existing script by reading the properties and assigning them to the existing JMeter variable in the User Defined Variables component

enter image description here

You can set a default value to the property ${__P(host,defaultHost)}. The script will continue to run on the local environment and Blazemeter.

References : JMeter Properties User Defined Variables

Janesh Kodikara
  • 1,670
  • 1
  • 12
  • 23
1

I fail to see where you "define" variables, to wit I see the names, not the values.

In order to refer the values which you provide via JMeter Properties section of the BlazeMeter load test configuration you need to use __P() or __property() functions in your Test Plan like:

enter image description here

This way you will be able to override the properties locally using -J command line argument like:

jmeter -Jhost=some-host -n -t test.jmx

and do the same using BlazeMeter's Jmeter Properties section.

More information: Apache JMeter Properties Customization Guide

Dmitri T
  • 159,985
  • 5
  • 83
  • 133