Not able to run .jmx file from command prompt

1

I am running the JMeter script through cmd[non-gui mode] but unfortunately, I am unable to run the same. can you please help me ?

D:\Jmeter\apache-jmeter-5.1.1\bin>jmeter -n -t Regular_Expression_Practice.jmx
Nov 13, 2019 5:19:42 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Could not open Regular_Expression_Practice.jmx

Also for solutions, I have checked the below parameter : - I am having java installed only once and also the same path added in the environment variable.

cmd
jmeter
load-testing
asked on Stack Overflow Nov 13, 2019 by Sanket

4 Answers

1
  1. To get rid of this bit:

    WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.

    open Command Prompt interpreter as Administrator and run JMeter. It can be done only once as normal User windows accounts cannot create registry keys.

  2. This error:

    Could not open Regular_Expression_Practice.jmx

    may stand for either Java installation corruption or impossibility to read the file from the file system. Try the following hints:

    • Run JMeter using ApacheJMeter.jar directly like:

      java -jar ApacheJMeter.jar -n -t Regular_Expression_Practice.jmx
      
    • If the above suggestion doesn't work check out jmeter.log file, normally it should contain enough troubleshooting information to get to the bottom of the failure reason

answered on Stack Overflow Nov 14, 2019 by Dmitri T
0

This issue can be from different reason

Please try this step and let me know your feedback

  • Make sure you install Java on your machine
  • Set java bin path in path enviornment variable
  • check java & javac two are work from command prompt
  • Make sure your script "Regular_Expression_Practice.jmx" is in bin folder if not mention full path of your script.

Run with abovbe configuration if it fail then try this

  • Go into your Start Menu and type regedit into the search field.
  • Navigate to path HKEY_LOCAL_MACHINE\Software\JavaSoft (Windows 10 seems to now have this here: HKEY_LOCAL_MACHINE\Software\WOW6432Node\JavaSoft)
  • Right click on the JavaSoft folder and click on New -> Key
  • Name the new Key Prefs and everything should work.

Hope this will help you

answered on Stack Overflow Nov 13, 2019 by RiDev
0

I guess that Warning Message is a known Java issue (not JMeter specific):

Groovy Shell warning "Could not open/create prefs root node ..."

So that leaves "Could not open Regular_Expression_Practice.jmx"

I strongly recommend that you double-check your filenames and provide the full path to your test plan as well as the jmeter.bat.

D:\Jmeter\apache-jmeter-5.1.1\bin\jmeter.bat -n -t "D:\WHEREEVER\Regular_Expression_Practice.jmx"
answered on Stack Overflow Nov 13, 2019 by monhelm
0

I also faced the same issue, but the solution was as simple as including the full path properly! (if the file path to the .jmx file has spaces be sure to include the double quotes to wrap around)

answered on Stack Overflow Feb 2, 2021 by Ashera

User contributions licensed under CC BY-SA 3.0