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