JMeter - Could not find the TestPlan class

梦想与她 提交于 2019-11-30 11:51:54

I had the same problem today with JMeter 2.13. When I saved it using this entry from the menu I received a jmx file that was accepted in non-GUI mode:

I too had the same error message. After creating the Test Plan and successful trial run on a Windows machine in GUI mode, I uploaded the JMX file to a Linux server to run in Command line mode.

After much searching and messing around I found that it was because I left the Test Plan name of the script to the default "Test Plan"!? When I changed it to "My Test Plan", for example, then saved and uploaded to the Linux server it ran successfully.

In testplan.jmx file contains:

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.8" jmeter="2.13 r1665067">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
    ...
    </TestPlan>

That contains predefined variables. But sometimes when you save your testplan.jmx like "Save as" this section can be missed. For my case, answer from @Marged help me: "File > Save test plan as..."

  1. Open JMeter in GUI mode, open your .jmx test plan you have created or create a new test plan, attempt to run the test plan in gui mode. It should prompt you to save before attempting the run, save the .jmx.
  2. Exit the GUI mode.
  3. Open command prompt, navigate to the bin file within the jmeter folder
  4. enter the jmeter -n -t "C:/Username/location of the .jmx file" command This should run as intended without the error.

This is how I solved the issue.

Possible you incorrect save your test plan. Try to open your flume_http_test.jmx i guess it contains only http request element without test plan element. Try to save your test with test plan element selected. http://joxi.ru/E2pvg4GSeLblrY

Use bin/jmeter instead of your command line:

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!