Develop an Automation interface (single threaded, test case)

Source: Internet
Author: User
Tags html form

Business process:

1. Provide written test cases, read content

2. Then automatically adjust the interface according to the use case content in Excel, determine whether the return value in the expected result is consistent with the value in the return message, generate a test report, send an email to inform

Implementation steps:

1. Read Excel and save the contents of the test case;

2. According to the request URL and parameter stitching request message in Excel, the interface is automatically called and the return message is saved;

3. Read the return message, compare the expected results, generate the test report, and send the message, and write the request message, return message and test result to excel in the test case.

Now I create the bin (launcher), cases (the final test case), conf (settings.py file, configure the sender, receiver, password, log and report directory) directory

Core directory ( get_case,interface_test, Report,SendMail,toolsfor the main process), Data (stored in the test report, in HTML form), logs (log file)

The following for different directories to write code, is not very professional.

The start.py code is as follows:

The Get_case code is as follows:

The Interface_test code is as follows:

The report code is as follows:

The SendMail code is as follows:

The tools code is as follows:

Developing an Automation interface (single thread, test case)

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.