Interface test automation - Getting Started

Interface Test

Meaning: The test tool / analog phones or web code to send a request to the server side, the server returns a result after receiving the request, given

Objective: Front usually only do a simple check format, so you can bypass the front end, to see if the code in question

All tests are based on the API interface http protocol

1: How do interface testing it?

  1. ---- interface document interface message configuration
    (interface address, the name of the interface, the request, the return value
    sample request, request parameters description Parameter Description Returns)
  2. ---- test tool constructed using the interface and transmits and receives messages
    (mainstream testing tools: jmeter, postman, loadrunner)

Two: the library installation requests

  1. Installation requests library

pip install requests

  1. How to test requests library has been successfully installed it?

Pycharm in import: import requests, without being given anything to prove successful installation

  1. commonly used ways:

requests.get() requests.post()

3: Use the library requests

1. Construction of a simple get request, the get request comprising: request header, URL, and IP address
Here Insert Picture Descriptionwhich can learn more about the status codes http:
Here Insert Picture Description
2.post request
Here Insert Picture Description

Released four original articles · won praise 0 · Views 20

Guess you like

Origin blog.csdn.net/weixin_46164132/article/details/104922495