Selenium2+python Automation 63-Simple Project construction

Source: Internet
Author: User

Objective

To unittest here can basically build a simple project framework, we can use a run_main.py script to control the execution of all the use cases, and generate reports, send messages a series of actions

First, the new project

1. Open the upper-left corner of Pycharm file>new project, enter the project name in location: D:\test\test_blog

2. Once created, select Opin in the current window to

II. Structure of the project

1. Under test Engineering, create a folder, be sure to choose the way Python package is created, or later import your own writing module will have a variety of problems

2. Create the following files under the project

--test_case This file folder to put all the test cases

----Blog_home can be divided by function use case module

---------Test_home

---------Test_home_1 test Case named after

----Blog_login

---------Test_login

----Blog_set

---------Test_set

--test_report

--run_main.py

Third, Run_main

1.run_main.py this script to write the main function, control the execution of all the use cases, and finally we just need to run the script on it.

2. We can also execute this script file in cmd, so that we do not rely on Pycharm to execute (follow up with Jenkins, same reason, start cmd execution script)

>>d:

>>CD Test\test_blog

>>python run_main.py

Selenium2+python Automation 63-Simple Project construction

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.