HttpRunner Automated Test Httprunner Running Mode

How to run httprunner:

  When httprunner performs interface testing, there are two ways to run it

Method 1: Run through the command line (CLI), the core commands are as follows

hrun: the abbreviation of httprunner, the function is exactly the same as httprunner Example: hrun ./path of project file, httprunner ./path of project file

locusts: performance based on Locust

har2case: Auxiliary tool that can convert har format (HTTP Archive) to YAML or JSON format

httprunner executes the command as follows:

1. Use the path of hrun ./project file; as shown below:

 2. The path of httprunner ./project file; as shown below:

Method 2: Integrate into your own project as a software package, call through class name. method, this method also supports parameterization

from httprunner.api import HttpRunner

runner = HttpRunner(failfast=False)

runner.run("XX.yml")

Note: This method will not automatically generate a test report 

Create a new py file in the root directory of the project, as shown below: run_httprunner.py

 The execution effect is as follows:

 Command line parameters commonly used by httprunner

Practical case

Optical theory is useless, you have to learn to follow along, and you have to do it yourself, so that you can apply what you have learned to practice. At this time, you can learn from some actual combat cases.

If it is helpful to you, please like and collect it to give the author an encouragement. It is also convenient for you to quickly find it next time.

If you don’t understand, please consult the small card below. The blogger also hopes to learn and progress with like-minded testers

At the right age, choose the right position, and try to give full play to your own advantages.

My road of automated test development is inseparable from the plan of each stage along the way, because I like planning and summarizing,

Test and develop video tutorials, study notes and receive portals! ! !

Guess you like

Origin blog.csdn.net/Liuyanan990830/article/details/132219361