0

I'm running tests on JMeter on a target server. So I start JMeter(GUI) on my Mac but it points to a Linux server and runs tests against it. I need to read a system property on the target server and use that in my If Controller.

System.getProperty("prop_name"); works if the property is defined on my mac. But it doesn't pick it up from the target server.

Any suggestion is much appreciated! Thanks!

user1124236
  • 453
  • 2
  • 7
  • 17

1 Answers1

0

I can suggest 2 options:

  1. If your application under test has JMX enabled - you can read the "interesting" property value in one of JSR223 Test Elements using Groovy code. The properties can be queried from the RuntimeMXBean.

    See Java Management Extensions (JMX) Technology Tutorial for more information.

  2. If there is no JMX exposed to the outer world you can still try to get the property value remotely. Be aware that you can run any command or program on remote Linux instance using SSH Sampler. SSH Sampler can be installed using JMeter Plugins Manager.

    See How to Run External Commands and Programs Locally and Remotely from JMeter for more information.

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