httprunner3.x (Introduction to Introduction)

Httprunner is a simple and elegant http(s) interface testing framework.

In the current testing industry, interface testing is already a necessary skill, and python is also one of the languages ​​that the majority of testing colleagues love. The httprunner tool has both interface recording/exporting, multiple case writing formats (json/yml/pytest), low entry barriers, flexibility and complete ecology.

httprunner focuses more on testing at the http(s) interface level; python's longest-lived unittest framework can be used as unit test automation, http(s)/tcp layer interface or function integration automation.

Because httprunner is becoming more and more famous, if you want to find a job, most Internet companies will more or less mention httprunner when they ask about interface testing.

httprunner has the following design philosophy:

  • Convention over configuration

     The principle of convention priority comes from a design philosophy in Spring. Simply put, the framework gives a set of specifications. This set of specifications can help you streamline configuration files as much as possible. As long as you write code in accordance with the specifications, you can reduce a lot of project configuration and code This relationship with configuration is very concise.

  • Pay attention to ROI matters

   Note that the return on investment is the core kpi of a framework. For example, as a new framework, what are the advantages of httprunner compared to other frameworks? Whether these advantages can cover the cost of adapting to httprunner (in short, what is the cost-effectiveness of learning a new thing)? At this point, httprunner strives to give users the greatest roi.

  • Embrace open source and use open source components to build a perfect ecosystem (Embrace open source, leverage  requestspytestpydanticallure  and  locust .)

    Embracing open source should be a trend in today's software industry. With more and more open source projects on github (even some surplus), many big cows have already created useful software tools for us. As a latecomer, it should be Build new software tools with the idea of ​​better integrating open source software (instead of reinventing the wheel)

What are the core functions of httprunner (3.x)?

  • Integrates the powerful functions of the requests library, and is more elegant and user-friendly in processing https requests (this means that the performance and stability of the httprunner (3.x) tool itself will be higher)
  • Provides yaml, json case writing format, and compiles and runs elegantly in pytest mode (more convenient to edit the converted python language test case)
  • Take advantage of har to conveniently record and export and generate test cases
  • Provides a series of mechanisms to support some complex test scenarios
  • Support the writing of custom functions through debugtalk.py plug-in
  • Through jmespath, it is convenient to verify the returned json
  • The function of httprunner is supplemented by the powerful plugin ecology of pytest
  • Through allure, make the test report more beautiful and more readable
  • Through the combination with locust, it is convenient to use httprunner to perform interface performance testing
  • httprunner runs in command line mode, and it is more convenient to access CI/CD

The above is a brief introduction to httprunner3.x. By the way, httprunner3.x is not compatible with httprunner2's case. If you originally used httprunner2.x , then the test case needs to be modified to adapt to the httprunner3.x case syntax.

Note: The above content is partly derived from the official website document translation of httprunner3.x.


Blogger: Test to make money

Motto: Focus on testing and automation, and strive to improve R&D efficiency; through testing and diligence to complete the original accumulation, through reading and financial management to financial freedom.

csdn:https://blog.csdn.net/ccgshigao

Blog Park: https://www.cnblogs.com/qa-freeroad/

51cto :https://blog.51cto.com/14900374


Guess you like

Origin blog.51cto.com/14900374/2589291