Python Interface Test (i)

Source: Internet
Author: User
Tags web services

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.

    1. 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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.