Http stress testing tool HttpTest4Net

Source: Internet
Author: User

HttpTest4Net is a C #-based and HTTP stress testing tool that allows you to perform a simple stress test on HTTP services. although. NET also integrates stress testing projects, but it is difficult to perform high concurrency stress testing on PCs with low configuration because of the resources occupied by, in addition, it is very troublesome to install a huge tool like. using HttpTest4Net, you only need to configure the parameters to perform stress tests on the existing HTTP service and obtain a detailed summary of the test results.

Function

 

  • Provides a test method for the total test time or the total number of requests.
  • Supports stress testing and transfer time for multiple users.
  • Supports basic GET and POST tests.
  • Provides the function of saving and loading test cases.
  • Provides custom writing test cases to be loaded into the tool.
  • The test summary function is provided to view the test results in real time and the distribution of the completed results.

 

Define test cases

The tool only provides basic GET and POST test cases, but these two tests may not meet the requirements in some scenarios. Therefore, the work provides the function of customizing test cases, developers may implement HttpTest4Net. interfaces. the IUrlTester interface implements more complex test cases. Compiled test cases only need to be compiled into DLL and placed in the directory where the test tool runs. the following is the POST test case implementation code provided by the component:

01 [Test("post base")]
02     public class PostUrlTester:IUrlTester
03     {
04         public PostUrlTester()
05         {
06             Encoding = "UTF-8";
07            
08         }
09         public string Url
10         {
11             get;
12             set;
13         }
14  
15         public string PostData
16         {
17             get;
18             set;
19         }
20  
21         public string Encoding
22         {
23             get;
24             set;
25         }
26          
27         public System.Net.HttpWebRequest CreateRequest()
28         {
29             HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
30             request.Method = "POST";
31             request.ContentType = "application/x-www-form-urlencoded; charset="+Encoding;
32             byte[] data = System.Text.Encoding.GetEncoding(Encoding).GetBytes(PostData);
33             request.ContentLength = data.Length;
34             Stream myStream = request.GetRequestStream();
35             myStream.Write(data, 0, data.Length);
36             myStream.Close();
37             return request;
38         }
39  
40         public TestType Type
41         {
42             get
43             {
44                 return TestType.POST;
45             }
46         }
47     }
Graphic tool usage

Download (runtime environment. NetFramework 4.0)

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.