Interface test-postman, JMeter and LoadRunner comparison

Table of contents

JMeter vs. LoadRunner Comparison

Disadvantages of JMeter

1. Create test case sets and subsets

2. Create test cases

3. Set variables

4. Add response processing

5. Execute test cases in batches

Summarize:


postman is a lightweight small tool from Google that specializes in testing interfaces~ (PS: postman includes two types: Chrome browser plug-in and postman client, I use postman client) although it is not as light as firefox's poster plug-in Quantity", but it is more comprehensive than firefox's poster plug-in and fiddler's interface testing function, and it is lighter and more convenient than Jmeter~

1.  Introduction to JMeter

     Apache JMeter is a 100% pure JAVA desktop application designed as software for testing client/server structures (such as web applications). It can be used to test the performance of static and dynamic resources, such as: static files, Java Servlet, CGI Scripts, Java Object, databases and FTP servers, etc. JMeter can be used to simulate massive loads to test the robustness of a server, network or object or to analyze overall performance under different loads.
     At the same time, JMeter can help you in regression testing your application. Use the test scripts and assertions you create to verify that your program returns expected values. For greater flexibility, JMeter allows you to use regular expressions to create these assertions.

 

JMeter vs. LoadRunner Comparison

JMeter is an open source (with typical open source tool features: unsightly interface ) testing tool, although it has many shortcomings compared with LoadRunner, for example: its result analysis ability is not as detailed as LoadRunner; it has many advantages:

  •   Open source, he is an open source free software, you don't need to pay any fees to use it,
  •   Small, compared to the huge size of LR (the latest LR11 is nearly 4GB), it is very small and does not require installation, but requires a JDK environment because it is a tool developed using java.
  •   Powerful, jmeter was originally designed as a simple web performance testing tool, but after continuous updates and expansions, it can now complete the testing of database, FTP, LDAP, WebService, etc. Because of its open source nature, of course you can also expand its functions according to your needs.

 The biggest difference between the two: jmeter does not support IP spoofing, but LR supports it.

Disadvantages of JMeter

  JMeter cannot be used to verify JS programs, nor can it verify the page UI, so it needs to cooperate with Selenium to complete the test of Web2.0 applications.

I think I prefer two functions of postman, one is its batch execution, and the other is its function of viewing source code. Let me share with you~

What I will share today is how postman executes interface test cases in batches. It is actually very simple, but it will bring a lot of convenience to our work. For example, we have written dozens of test cases, and the requests are all from the same server IP. Once the server IP address changes from When the test environment is moved to the online environment, all server IPs need to be modified. If the test cases cannot be saved, the server IPs can be modified uniformly, and executed in batches, it will be very troublesome! But postman helped us solve this problem perfectly~ Please see below for specific operations~

1. Create test case sets and subsets

As shown below,

Click the add folder icon under Collections on the left side of postman to create a test case set. A system, module or other test cases with granularity can be stored in this directory

In addition, subdirectories can also be created in this directory to subdivide test cases, as shown in the following figure: 

2. Create test cases

Create an interface test case, that is, create a new http request, select the request method, write the url, request header, and request body

3. Set variables

The variable of postman is similar to the parameterization of Jmeter, that is, the value that appears multiple times in several places is represented by a variable, so as to achieve the effect of one modification and multiple places, which is convenient for modification and management.

Click a button above postman, click the Edit button behind Globals, and add global variables

 

Click the Add button in the lower right corner to add Environment Name, write the variable name for the Key value, write the value corresponding to the variable for the Value value, and click the Save button to save

 

Use { {key}} to replace the Value value. For example, take the above screenshot as an example, use "{ {baseURL}}" to replace http://172...57:8080

 

4. Add response processing

Response processing is somewhat similar to the checkpoint in Jmeter, which is to judge whether the test passes by checking whether the response data meets expectations. To add check conditions in Tests, postman provides some common check condition codes, which can be added directly or slightly modified. For example, if the status code of the response data is 200, it is judged that the test is passed, and then select "status code: code is 200" in the code slice

 

tests["Test Response contains Wednesday"]=responseBody.has("10th Wednesday")
tests["Test Response contains Wednesday"]=responseCode.code === 200;

5. Execute test cases in batches

Click "run" in the test case set to run the test cases in batches, the collection runner will pop up, click "Start Run" to run the test cases in batches

After running, the test results will pop up, showing the number of passed and failed tests, request URL, request header, request body information, response header, response body information, status code, etc., and we can view the execution results and specific information of the test case. ~

Summarize:

Thanks to everyone who read my article carefully! ! !

 I personally sorted out some technical materials I have compiled in my software testing career in the past few years, including: e-books, resume modules, various job templates, interview books, self-study projects, etc. Welcome everyone to click on the business card below to get it for free, don't miss it.

   Python automated testing learning exchange group: a full set of automated testing interview resume learning materials to obtain Click the link to join the group chat [python automated testing exchange]: http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=DhOSZDNS -qzT5QKbFQMsfJ7DsrFfKpOF&authKey=eBt%2BF%2FBK81lVLcsLKaFqnvDAVA8IdNsGC7J0YV73w8V%2FJpdbby66r7vJ1rsPIifg&noverify=0&group_code=198408628

Guess you like

Origin blog.csdn.net/MXB_1220/article/details/131563356