The GUI as steps
A plan can be built in two ways: in JMeter's window, where the tree, the property panels and the result viewers are, or in a text editor, where this course builds it. The window is the easier place to learn the elements and the only place to record a test or look at one response at a time. This lesson maps the panels to the properties the earlier lessons ran, as steps, and shows why the window does not open in this container.
The window, as steps
- Start it. jmeter with no arguments opens the window. The left pane is the tree of the plan, the right pane the properties of the element selected in it, and the toolbar is the green arrow to run, the stop button, the broom to clear results and the save disk.
- Add a thread group. Right-click Test Plan, Add → Threads (Users) → Thread Group. The panel has the number of threads, the ramp-up, the loop count, the same-thread-group-as-previous checkbox, the scheduler and the "Action to take after a sampler error" list, which is the on_sample_error of the thread group lesson.
- Add defaults and a request. Under the thread group: Add → Config Element → HTTP Request Defaults for the host and port, then Add → Sampler → HTTP Request for the path and the method. An empty field takes the value of the defaults.
- Add a listener. Add → Listener → View Results Tree shows one request and one response at a time while the plan is being built; Summary Report shows the table the headless summariser prints. Both are for building, not for a load test.
- Run and look. The green arrow runs the plan in the window and the listeners fill as the samples arrive. A red number in the result means a failed sample; the View Results Tree shows the assertion message under the sampler.
- Save. File → Save Test Plan as writes the .jmx this course shows. From then on the plan is a file and the command line can run it.
The panel and the file
Every field of a panel is a property of the file. The table gives the ones this part used, so that a reader who has the window open can find them.
| In the window | In the file |
|---|---|
| Thread Group → Number of Threads | ThreadGroup.num_threads |
| Thread Group → Ramp-Up Period | ThreadGroup.ramp_time |
| Thread Group → Loop Count | LoopController.loops |
| Thread Group → Action to take after a sampler error | ThreadGroup.on_sample_error |
| HTTP Request → Path | HTTPSampler.path |
| HTTP Request → Follow Redirects | HTTPSampler.follow_redirects |
| HTTP Request → Use KeepAlive | HTTPSampler.use_keepalive |
| HTTP Header Manager → a row | a Header element with Header.name and Header.value |
| Response Assertion → Ignore Status | Assertion.assume_success |
| Simple Data Writer → Filename | filename of the ResultCollector |
What this container answers instead
A container has no display, and the window is a Swing program. The command that opens it here is the one of the JMeter archive itself, with the headless flag set, and it stops before a window exists:
java -Djava.awt.headless=true -jar /opt/jmeter/bin/ApacheJMeter.jar 2>&1 | tail -5; echo "exit status: ${PIPESTATUS[0]}"
& increase Java Heap to meet your test requirements:
Modify current env variable HEAP="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m" in the jmeter batch file
Check : https://jmeter.apache.org/usermanual/best-practices.html
================================================================================
An error occurred: Fontconfig head is null, check your fonts or fonts configuration
exit status: 1
The heap advice and the best-practices link are printed before every GUI start. Then the toolkit gives up on the fonts, because there is no font server behind a display that does not exist. The line is a real error of this image and not a property of JMeter: on a desktop the same archive opens the window.
The steps above are therefore shown and not run, and the rest of the course does not need them. A plan that a reader builds in the window is the file the next lessons edit by hand, and every command in the course is one a headless run uses.
Related
- The .jmx file: what the save writes.
- Recording a test: the one thing the window does that a text editor does not.
- Listeners in headless mode: why the viewer of the window stays out of a load test.
Автор статьи: Arthur Isaev