0
votes

All: i am trying to run a jmeter script from command line where the script is present in git hub.when i try to execute i am getting the error below, however all the local jmx scripts are working fine. Any help can be appreciated....

C:\Users\Documents\apache-jmeter-3.0\apache-jmeter-3.0\bin>jmeter -n -t https://github.com/jmeter_test/master/Ast1.jmx Writing log file to: C:\Users\apache-jmeter-3.0\apache-jmeter-3 .0\bin\jmeter.log Could not open https://github.com/jmeter_test/master/Ast1.jmx

2
JMeter doesn't support providing URL for a script.Kiril S.

2 Answers

0
votes

As far as I know JMeter doesn't support scripts to be added and run via a URL. For example, Try to open a script from the same GitHub location in the GUI mode. I guess you won't be able to! It will allow you to select script from your system or your local network only. Same principle applies for Non-GUI mode as well. Your test script needs to be on the system or on the same local network from where you are running your tests.

0
votes

Method 1:

You can do it if you use Jmeter from the Java code as specified here: " RUN A JMETER TEST THROUGH A PROGRAM (FROM JAVA CODE)" for an existing jmx.

Instead of a FileInputStream you can use URL.openStream as described in this other post here.

Method 2:

Use Jmeter from the Java code as specified, but instead of specifying an existing jmx you can define it in the code.

    // Test Plan
    TestPlan testPlan = new TestPlan("Create JMeter Script From Java Code");

    // Construct Test Plan from previously initialized elements
    testPlanTree.add("testPlan", testPlan);
    testPlanTree.add("loopController", loopController);
    testPlanTree.add("threadGroup", threadGroup);
    testPlanTree.add("httpSampler", httpSampler);

    // Run Test Plan
    jmeter.configure(testPlanTree);
    jmeter.run();