"Three" JMeter Interface Automation Test series of HTTP interface automation combat

Source: Internet
Author: User
Tags http cookie

Bug

This article describes the HTTP interface Automation test for Jmeter tools!

For versatility, take the website as a practical example!

Essential Skills: HTTP interface Basics, grasping the package, this article does not do a detailed introduction, will not be the first Baidu to fill!

First, we capture the packet that knows about the login:

Let's grab it. Get

The corresponding script for Jmeter is as follows:

Get the Discovery column script:

Use the regular expression extractor to extract the contents of the column (what? No regular expression? Find Baidu)


Using a foreach controller to merge extraction results into a single string



Printing results:


Operation Result:


There are a few things to keep in mind when testing HTTP interfaces:

    1. Cookie processing, normal process, can be operated with the HTTP Cookie Manager manager!
    2. Special process, if you need a custom cookie, can be processed by adding a cookie field to the HTTP header manager!
    3. Content-type is very important, if the call interface error, to troubleshoot other cases without problems, nine out of ten is the Content-type format is not the result!
    4. In the performance test, the HTTP interface time-out must set a default value, or in the JMeter distributed testing, the remote server side often can not shut down, need to manually restart, at that time to write a remote restart JMeter server software, embarrassing!
    5. With JMeter for interface Automation testing, you can use BeanShell to process data, business rule validation, and use JDBC requests and regular expressions to extract database data and Web page data for automated process and data reconciliation!
    6. More advanced methods, you can put JMeter on the server, and then make calls through Jenkins, you can also write some file plug-ins (Excel), generate comparison results!

Sample script: Http://files.cnblogs.com/files/artoftest/3.zip

Next we introduce the combination of HTTP request, BeanShell, JDBC request, regular expression extractor, to achieve automated data flow and data reconciliation, interested friends can pay attention to, thank you!

"Three" JMeter Interface Automation Test series of HTTP interface automation actual combat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.