-2

how to convert the floating variable into hex in JMETER.

Any idea, thanks.

Harmya
  • 41
  • 8

1 Answers1

0

There is Commons Codec library in JMeter Distribution bundle which provides Hex class which in its turn exposes encodeHex() function which you can use to convert an ASCII string into its Hex representation like:

Given you need to convert LLOP123344 string it's sufficient to call the aforementioned function like:

org.apache.commons.codec.binary.Hex.encodeHexString('LLOP123344'.getBytes('UTF-8'))

which returns 4c4c4f50313233333434

enter image description here

More information: Apache Groovy - Why and How You Should Use It

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