13

I use Blazemeter Chrome Extension to record my Jmeter Test Plans. These recorded scripts are very helpful as they record cookies, variables and sessions that are required and I don't need to take the headache of doing all that manually. These scripts run perfectly fine in the GUI mode of Jmeter.

The problem I'm facing is to execute the same Test Plan in non GUI (from command line) mode. I haven't changed/modified the jmx file that was executing perfectly in the GUI mode. Now when I try to run the test from command line using below command It returns with an error saying "Could not open Test.jmx". That is, jmeter is not able to open the Test Plan file when executing in non GUI mode.

jmeter -n -t Test.jmx -l results.jtl

  • I think full command is jmeter -n -t Test.jmx example.jtl , you missing jtl file name? – Helping Hands Jan 8 '16 at 7:08
  • What error is returned? and have you tried giving complete path to jmx file? – TestingWithArif Jan 8 '16 at 7:40
  • 9
    @ Helping Hands, I've edited the command to the actual thing that I tried. – IAmMilinPatel Jan 8 '16 at 8:40
  • 10
    @ TestingWithArif The error I've mentioned in the description above and yes I tried it with the absolute path as well but still got the same result. Infact when I created a simple test plan in Jmeter GUI with just 1 http request sampler and tried that in non GUI mode, it worked fine. – IAmMilinPatel Jan 8 '16 at 8:42
12

After a lot of Googling and trial and error I found out that a tag in the JMX file that Blazemeter's Chrome Extension generates was creating a problem.

The JMX file included a <hashTree/> in several places and this tag was causing the JMX file to not being read by Jmeter in non GUI mode.

So I removed this tag and tried to run the test and got a hell lot more errors than earlier.

Then I added 2 asterisks [**] before and after the hashTree tag. So the tag now looked like **<hashTree/>** and saved the JMX file.

Now when I ran the test via non GUI mode it executed perfectly fine.

Happy Testing :)

TESTacy

  • 2
    You can accept it as answer :) I guess it could also be reported to Blazemeter team! – TestingWithArif Jan 12 '16 at 4:49
  • 10
    Yep wrote an email to Blazemeter support, but as per them there is nothing wrong with the way test plan is being generated! So lets see if they really do fix it. Otherwise we'll have ti do this one thing manually every time! :) – IAmMilinPatel Jan 12 '16 at 5:04
  • Thats strange. I will check in my environment and share here. If it works fine for me then may be there is something else in your environment causing the issue! – TestingWithArif Jan 12 '16 at 5:17
  • 1
    adding ** did not solve my issue but restarting my mac did. I am serious and not kidding – Tarun Jan 30 '17 at 9:05
  • Didn't work for me, and reboot also didn't work either :( – David Aug 24 '17 at 4:56
0

Try to pass the jmx file within quotes as below - worked for me

jmeter -n -t "Test.jmx" -l results.jtl

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.