1. Concept:
Interface testing is a test of the interface between components of a test system. Interface testing is primarily used to detect the interaction points between external systems and systems, as well as within each subsystem. The focus of testing is to examine the exchange of data, the transfer and control of management processes, and the mutual logical dependencies between systems.
- 2. Environment Readiness:
(1.) Install Python
https://www.python.org/downloads/Download the version you want to use (the version described in this article is version 3.5). After installation, add the system environment variables. Enter Python in cmd,
(2.) Install the Requests library.
https://pypi.python.org/pypi/requests/, then go to cmd. Go to download directory, install Python setup.py installed
can also be in the CMD input pip install requests installation, installed, Python pour requests see if error
Import requests not error is installed successfully
Requests document Chinese version:
Http://docs.python-requests.org/zh_CN/latest/user/quickstart.html
For interface testing, it is generally divided into two cases, which are based on HTTP protocol and Web services protocol, but the most common is HTTP protocol-based
Interface testing, where the most common HTTP methods are get and post, and of course the Put,delete request, the process of interface testing is the client (browser) to the server (service
Requests a request, the server receives the request, the response returns to the client response data.
Get: Getting data from a specified resource
such as in Baidu Search input Selenium-python return results,,
Post: Data to be processed to the specified resource, to log into the blog Park for example
Obviously from the results of our login is a failure.
PUT: Uploads the specified URL, which is generally modified to be understood as an update in the database.
Delete: Deletes the specified resource.
In the interface test, in general, Post creates data, get gets all the data after the successful creation and the specified data, put can the data after the successful creation
To modify, delete is the specified resource.
Python Interface Test (i)