I have large text files, which should be Base64
encoded. I tried to open it in Notepad++
and encode it with Base64
converter plugin. It was finished in ~10 minutes, but I cannot select output string to use it in JMeter
. Files are to long to select it and copy to some converters.
Asked
Active
Viewed 1,192 times
0

plaidshirt
- 5,189
- 19
- 91
- 181
-
Have you tried this: https://stackoverflow.com/a/3715530/8293848 only three lines of python code. No need to open/copy/paste in editor. – Hayati Gonultas Jan 29 '18 at 10:05
-
@HayatiGonultas : How to paste in JMeter suite without copying it? – plaidshirt Jan 29 '18 at 10:08
-
I hope jmeter and other converters accepts input from file. In fact it seems that jmeter does accept file input. – Hayati Gonultas Jan 29 '18 at 10:13
-
No, it can't, check this: https://bz.apache.org/bugzilla/show_bug.cgi?id=61732 – plaidshirt Jan 29 '18 at 11:53
1 Answers
2
You can use the following functions combination:
- __FileToString() - comes with JMeter already
- __base64Encode() - provided by JMeter Plugins project as a part of Custom JMeter Functions bundle
The syntax would be:
${__base64Encode(${__FileToString(/path/to/your/file,,)},)}
You can install __base64Encode()
(and other) functions using JMeter Plugins Manager:

Dmitri T
- 159,985
- 5
- 83
- 133
-
Request is executed, but I can't see details, because I get a white screen on response tab. I use these setting: `set HEAP=-Xms512m -Xmx5112m` , but I see error: java.lang.OutOfMemoryError: Java heap space Dumping heap to java_pid9972.hprof ... Heap dump file created [2861833605 bytes in 93.476 secs] Uncaught Exception java.lang.OutOfMemoryError: Java heap space. See log file for details. – plaidshirt Jan 29 '18 at 11:51