HttpRunner passes variable values across files & outputs variable values

Passing & outputting variable values ​​across files

output:  output variable value, this parameter is replaced by export in httprunner2.2 version, the function of passing parameters across files does not take effect after httprunner2.2. (But in the actual testing process, you can also use the cross-file function)

export:  Output variable values, and variable values ​​can be passed across files (recommended)

Passing across files

Example: the use case layer refers to the use case layer, which can be transferred across files through export

The -token under the export keyword in the figure below can output variable values, and can also perform cross-file transfer

 In the following figure, the use case layer refers to the interface of the use case layer. The variable - token transferred across files in the above figure can be extracted through the extract keyword. The writing format is the same: under the keyword: - variable

output variable value

Example:

Use the export keyword to output the contents of the variable

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/129888387