当前位置:网站首页>How to use JMeter for interface testing

How to use JMeter for interface testing

2022-06-25 23:01:00 Old t teaching test

1, understand jmeter The overall architecture of interface testing

        1) test plan : Don't worry about this , This is the fixed default

        2) Thread group : From the business level, it can be understood as a whole business scenario or process , Under the thread group, there can be multiple http request

        3)http request : The interface supporting the whole business in the business scenario , Simply put, set the interface here

        4) View the result tree : View the request or response information of the interface .

2, The overall architecture is explained in detail

        1) Thread group :

                      For us to do interface testing , In the thread group, you only need to understand the function of the number of cycles , It is not difficult to understand from the literal meaning , Is the number of cycles to the request interface . notes : The operation of each thread group only applies to http request , If you create a group with multiple threads , Each thread group is independent , Operation without collusion and interference .

        2)http request :

                agreement : Represents the protocol of the interface , It's usually http or https.

                 Server name or ip: Indicates the domain name or route .

                 Port number : Port number of the interface , If there is no separate setting, it will not be filled in by default

                http request : The request mode of the interface , You can choose from the drop-down menu

                route : Path of interface

                Parameters : Upload form data

                Message body data : When the interface needs to upload data in text or other formats

                Upload files : Upload file settings

        Let's say I have one post request , The port number is 88888 Of login Interface :https://applogin.com/login. He needs to pass 2 Parameters , One is users, The other one is password. The picture below is in jmeter Request settings on .

        3) View the result tree :

                View the interface response or request contents , Roughly divided into 2 part , One part is the content presentation format , The other part is the presentation of the content , notes : Click the green arrow at the top to execute , It's the arrow on the left, not the arrow on the right

        

                                                                      Text format  

                                                                  Content display ( Request and response information )

Later articles will explain : Request header , Parameters , Assertion , And extractors

If there is no interface for the experiment, you can make private comments , use Python Yes 3 Interface , The data content comes from the table , Sign in , register , Cancellation .

原网站

版权声明
本文为[Old t teaching test]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251920175520.html

随机推荐