1
votes

I want to conduct performance testing on a single page application.I want to do that programmatically .As I know performance testing for SPA includes both client_end page loading,java script execution time and server_end response time, against asynchronous Ajax calling.

I used JMeter API programmatically for running test script at server_end by following How to create and run Apache JMeter Test Scripts from a Java program? this.

Now I want to run test script for client_end using JMeter WebDriver API programmatically.I follow this How to approach "end-client" performance testing on single-page (web) applications? but it doesn't give me enough information on how to use JMeter WebDriver API programmatically.

So my question is How can I use WebDriver API programmatically? Any suggestion???

1
Could you please let us to know what no goes smoothly? Examples, code that not works, etc.Eugene
First of all thank you @Eugene for responding .I just want to know how can I create webDriver sampler,configure it ,add test plan and then run the test plan programmatically using JMeter Web driver plugins .I have already downloaded the required plugin jar file from this site [JMeter_web_driver ](jmeter-plugins.org/downloads/all) and run a test plan from JMeter doing this tutorial Web_Driver_Tutorial.I just want to do it programmatically from a simple java program using the plugins library.MRHMisu
So if you prepare and debug everything with the JMeter GUI inside the Script window and then launch this with the JMeter command line - is it will work?Eugene

1 Answers

0
votes

I would suggest the following

  1. Use JMeter GUI and the script inside JMeter GUI like you did.
  2. Save the script as *.jmx file

Use the following snippet for the automation

// Load existing .jmx Test Plan
FileInputStream in = new fileInputStream("/path/to/your/jmeterTest.jmx");
HashTree hash = SaveService.loadTree(in);
in.close();
// Run JMeter Test
jmeter.configure(hash);
jmeter.run();