CN106354648B - A kind of python automated test frame system and test method - Google Patents

A kind of python automated test frame system and test method Download PDF

Info

Publication number
CN106354648B
CN106354648B CN201610803458.XA CN201610803458A CN106354648B CN 106354648 B CN106354648 B CN 106354648B CN 201610803458 A CN201610803458 A CN 201610803458A CN 106354648 B CN106354648 B CN 106354648B
Authority
CN
China
Prior art keywords
test
case
script
environment attribute
testing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610803458.XA
Other languages
Chinese (zh)
Other versions
CN106354648A (en
Inventor
李儒华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fibocom Wireless Inc
Original Assignee
Fibocom Wireless Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fibocom Wireless Inc filed Critical Fibocom Wireless Inc
Priority to CN201610803458.XA priority Critical patent/CN106354648B/en
Publication of CN106354648A publication Critical patent/CN106354648A/en
Application granted granted Critical
Publication of CN106354648B publication Critical patent/CN106354648B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Testing Of Individual Semiconductor Devices (AREA)

Abstract

The present invention provides a kind of python automated test frame system, including test script functional interface module, for writing test script, and the environment attribute that each test script corresponds to test case is arranged, and multiple test cases form set of uses case;Test case loading module, the set of uses case and the selected need test case to be tested for loading selected;Testing control module, for preset test environment attribute to be arranged, and the environment attribute of test case described in automatically scanning, the test case attribute is matched with preset test environment attribute;Test result for executing the specified test case of testing control module, and is back to the testing control module by testing execution module.Compared with the relevant technologies, python automated test frame system provided by the invention can ignore the test script that with the unmatched test script of test environment and execution matches with test environment automatically.

Description

A kind of python automated test frame system and test method
Technical field
The present invention relates to software test field more particularly to a kind of python automated test frame system and test sides Method.
Background technique
With the development of software automated testing technology in recent years, be characterized in efficient automated test frame technology with it is excellent The appearance of elegant automated test tool, largely improves the development efficiency of automatic test script, while also right The requirement of the automatic test of software is higher and higher.
In the software automated testing of the relevant technologies, the test script of same test use cases will build several differences respectively Test environment, when automatized script continuously performs, can because test environmental difference cause test crash, test environment broken Bad and test execution obstruction, to keep automatic test cumbersome, automatic test efficiency is had a greatly reduced quality.
Therefore, it is necessary to provide a kind of new python automated test frame system and test method solves above-mentioned ask Topic.
Summary of the invention
The technical problem to be solved by the invention is to provide ignore automatically and test the unmatched test script of environment and hold The python automated test frame system and test method for the test script that row matches with test environment.
In order to solve the above technical problems, the present invention provides a kind of python automated test frame system, comprising:
For writing test script, and the corresponding test of each test script is arranged in test script functional interface module The environment attribute of use-case, multiple test cases form set of uses case;
Test case loading module for the set of uses case of loading selected, and is selected and is needed to be implemented in the set of uses case The test case;
Testing control module, for preset test environment attribute to be arranged, and test case described in automatically scanning is concentrated each Then the environment attribute of the test case compares the environment attribute of the test case and the test environment attribute Compared with notifying testing execution module to execute the test case when the environment attribute and the test environment attribute match The test script, mismatch then ignore the test script;
Testing execution module, for executing the specified test script of the testing control module, and by test result It is back to the testing control module.
A kind of test method of python automated test frame system is provided, comprising the following steps:
Test script is write, test script is write by test script functional interface module, and each test is set Script corresponds to the environment attribute of test case, and multiple test cases form set of uses case;
Loading set of uses case and selecting needs implementation of test cases, passes through the specified use-case of test case loading module load Collection, and the selected multiple test cases needed to be implemented;
Judge whether the environment attribute of test case matches with test environment attribute, be arranged by testing control module described in The preset test environment attribute of testing control module, the environment category of test case described in the testing control module automatically scanning Property, and the environment attribute of the test case of scanning and the preset test environment attribute are compared, when the environment attribute Do not match with the test environment attribute, testing execution module is notified to execute the test script of the test case, not With then ignoring the test script;
Test script executes automatically, executes the institute to match with the test environment attribute by the testing execution module Test case is stated, and test result is returned into notice to the testing control module.
Preferably, the test script executes in step automatically, the testing control module real-time display testing progress and Test result.
Preferably, the load set of uses case and it is selected need in implementation of test cases step, the test case loading module One test use cases of single load select one or more test cases.
Preferably, the test script executes in step automatically, and the testing execution module single executes a survey Example on probation.
Preferably, described to write in test script step, the test script is retouched by log divider and test environment State device modification.
Compared with the relevant technologies, the test method of python automated test frame system provided by the invention includes load Test case and two steps of test script for identifying test case environment attribute and implementation of test cases, effectively prevent Test crash, test environment is caused to be destroyed and test because testing environmental difference when python automatized script continuously performs Obstruction is executed, the test case for meeting test environment and execution is selected automatically, is not necessarily to other troublesome operations, high degree of automation.
Detailed description of the invention
Fig. 1 is the structural block diagram of python automated test frame system of the present invention;
Fig. 2 is the flow chart of python automated test frame system test method of the present invention.
Specific embodiment
Below in conjunction with drawings and embodiments, the invention will be further described.
Fig. 1 is please referred to, is the structural block diagram of python automated test frame system of the present invention.The python automation Test frame system 100 include test script functional interface module 1, test case loading module 2, testing control module 3 and Testing execution module 4.
The test script functional interface module 1 is for writing test script, and it is corresponding that each test script is arranged The environment attribute of test case, multiple test cases form set of uses case.
Tester writes the test script according to basic API (Advanced Programmers Interface), And the environment attribute that each test script corresponds to test case is set, wherein the type and value of environment attribute can roots It is customized according to actual conditions.The set of uses case is made of multiple test cases, and the test script passes through log divider It is modified with test environment describer, each test script passes through the modification of Setup function, each test before executing Environment cleaning function is tested by Teardown after script execution success or failure to be cleared up.
The test case loading module 2, which is used to load the specified set of uses case and select in the set of uses case, to be needed to hold The capable test case.
The testing control module 3 is for being arranged preset test environment attribute, and each test case of automatically scanning The environment attribute, then the environment attribute of the test case is compared with the test environment attribute, when described Environment attribute and the test environment attribute match, and testing execution module 4 is notified to execute the test of the test case Script, mismatch then ignore the test script.
The testing execution module 4 is used to execute the specified test case of the testing control module 3, and will test As a result it is back to the testing control module 3.
By to each corresponding test environment attribute of test case configuration, then the testing control module 3 from Whether the environment attribute of the dynamic scanning test case matches preset test environment attribute, when the environment attribute of the test case Match with the preset test environment, notify the test script for executing the test case, mismatch is then ignored described The test script of test case makes so as to effectively distinguish the test environment of the different test cases in automation nothing In people's test on duty, tester only needs to be arranged current test environment attribute, by the test script of the set of uses case It all executes, the python automated test frame system 100 can be selected automatically meets the described of the test environment Test case executes, and is not necessarily to other troublesome operations.
It is the flow chart of python automated test frame system test method of the present invention incorporated by reference to reference Fig. 2.There is provided one The test method of the kind python automated test frame system 100, comprising the following steps:
Step S1, writes test script, writes test script by test script functional interface module 1, and be arranged each The test script corresponds to the environment attribute of test case, and multiple test cases form set of uses case;
In this step, the test script is modified by log divider and test environment describer.
Step S2, loading set of uses case and selecting needs implementation of test cases, specified by the load of test case loading module 2 The set of uses case, and the selected multiple test cases needed to be implemented;
In this step, 2 single load of test case loading module, one test use cases select one or more A test case.
Step S3, judges whether the environment attribute of test case matches with test environment attribute, passes through testing control module 3 The preset test environment attribute of the testing control module 3, test case described in 3 automatically scanning of testing control module are set Environment attribute, and the environment attribute of the test case of scanning and the preset test environment attribute are compared, when described Environment attribute and the test environment attribute match, and testing execution module 4 is notified to execute the test of the test case Script, mismatch then ignore the test script;
Step S4, test script execute automatically, are executed and the test environment attribute phase by the testing execution module 4 The matched test case, and test result is returned into notice to the testing control module 3.
In this step, 4 single load of testing execution module, one test case.The testing control module 3 Real-time display testing progress and test result understand testing progress and test result for tester in real time.
Compared with the relevant technologies, the test method of python automated test frame system of the invention includes load test Use-case and two step of test script for identifying test case environment and implementation of test cases effectively prevent python automation foot When originally continuously performing because test environmental difference cause test crash, test environment be destroyed and test execution obstruction, automatically The test case for meeting test environment and execution are selected, other troublesome operations, high degree of automation are not necessarily to.
The above description is only an embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (6)

1. a kind of python automated test frame system characterized by comprising
Test script functional interface module for writing test script, and is arranged each test script and corresponds to test case Environment attribute, multiple test cases form sets of uses case;
Test case loading module, for the set of uses case of loading selected, and select needed to be implemented in the set of uses case it is more A test case;
Testing control module, for preset test environment attribute to be arranged, and each test in set of uses case described in automatically scanning Then the environment attribute of the test case is compared, when described by the environment attribute of use-case with the test environment attribute Environment attribute and the test environment attribute match, and testing execution module is notified to execute the test of the test case Script, mismatch then ignore the test script;
Testing execution module for executing the specified test script of the testing control module, and test result is returned To the testing control module.
2. a kind of test method of python automated test frame system, which comprises the following steps:
Test script is write, test script is write by test script functional interface module, and each test script is set The environment attribute of corresponding test case, multiple test cases form set of uses case;
Load set of uses case and the selected set of uses case for needing implementation of test cases, being specified by the load of test case loading module, And the selected multiple test cases needed to be implemented;
Judge whether the environment attribute of test case matches with test environment attribute, the test is arranged by testing control module The preset test environment attribute of control module, the environment attribute of test case described in the testing control module automatically scanning, and The environment attribute of the test case of scanning and the preset test environment attribute are compared, when the environment attribute with it is described Test environment attribute matches, and testing execution module is notified to execute the test script of the test case, and mismatch is then neglected The slightly described test script;
Test script executes automatically, executes the survey to match with the test environment attribute by the testing execution module Example on probation, and test result is returned into notice to the testing control module.
3. the test method of python automated test frame system according to claim 2, which is characterized in that the survey Training originally executes in step automatically, the testing control module real-time display testing progress and test result.
4. the test method of python automated test frame system according to claim 2, which is characterized in that described to add Carrying set of uses case and selecting needs in implementation of test cases step, and test case loading module single load one test is used Example collection, selectes multiple test cases.
5. the test method of python automated test frame system according to claim 2, which is characterized in that the survey Training originally executes in step automatically, and the testing execution module single executes a test case.
6. the test method of python automated test frame system according to claim 2, which is characterized in that the volume It writes in test script step, the test script passes through log divider and test environment describer modification.
CN201610803458.XA 2016-09-06 2016-09-06 A kind of python automated test frame system and test method Active CN106354648B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610803458.XA CN106354648B (en) 2016-09-06 2016-09-06 A kind of python automated test frame system and test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610803458.XA CN106354648B (en) 2016-09-06 2016-09-06 A kind of python automated test frame system and test method

Publications (2)

Publication Number Publication Date
CN106354648A CN106354648A (en) 2017-01-25
CN106354648B true CN106354648B (en) 2019-01-22

Family

ID=57859523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610803458.XA Active CN106354648B (en) 2016-09-06 2016-09-06 A kind of python automated test frame system and test method

Country Status (1)

Country Link
CN (1) CN106354648B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107797930B (en) * 2017-10-27 2021-04-23 东信和平科技股份有限公司 Method, system, device and readable storage medium for testing functions of smart card
CN107844426A (en) * 2017-11-24 2018-03-27 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN108959080B (en) * 2018-06-27 2021-01-15 苏州浪潮智能科技有限公司 Automatic testing method based on UnitTest parallel execution
CN109240923B (en) * 2018-08-31 2021-06-04 福建天泉教育科技有限公司 Interface test script generation method and computer readable storage medium
CN109739769B (en) * 2019-01-02 2022-06-07 深圳忆联信息系统有限公司 BOOTROM loading function automatic test method and device
CN112069057A (en) * 2020-08-07 2020-12-11 长沙市到家悠享网络科技有限公司 Code testing method, device, apparatus and storage medium
CN113190449A (en) * 2021-05-07 2021-07-30 广东美房智高机器人有限公司 Management platform and robot MQTT protocol testing method, system, equipment and medium
CN113407440B (en) * 2021-05-24 2024-02-09 深圳市广和通无线股份有限公司 Testing system and method for wireless communication module
CN113238953A (en) * 2021-05-26 2021-08-10 杭州安恒信息技术股份有限公司 UI automation test method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899149A (en) * 2015-06-29 2015-09-09 上海瀚银信息技术有限公司 Automatic testing management method
CN105530140A (en) * 2014-09-30 2016-04-27 中兴通讯股份有限公司 Cloud scheduling system, method and device for removing tight coupling of use case and environment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2175373B1 (en) * 2008-10-09 2016-06-08 Accenture Global Services Limited Test data creation and execution system for service oriented architecture
US20140245264A1 (en) * 2013-02-28 2014-08-28 International Business Machines Corporation Identifying Test Cases Based on Changed Test Code

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105530140A (en) * 2014-09-30 2016-04-27 中兴通讯股份有限公司 Cloud scheduling system, method and device for removing tight coupling of use case and environment
CN104899149A (en) * 2015-06-29 2015-09-09 上海瀚银信息技术有限公司 Automatic testing management method

Also Published As

Publication number Publication date
CN106354648A (en) 2017-01-25

Similar Documents

Publication Publication Date Title
CN106354648B (en) A kind of python automated test frame system and test method
CN105608254B (en) A kind of the Automation Design method and platform towards Intelligent hardware system development
US7895575B2 (en) Apparatus and method for generating test driver
US9582620B1 (en) Method and system for automated refined exclusion of entities from a metric driven verification analysis score
CN102595184B (en) Intelligent television automation test method and system
CN111143188B (en) Method and equipment for automatically testing application
CN109933520A (en) Software development test method, device, computer installation and storage medium
CN112306880A (en) Test method, test device, electronic equipment and computer readable storage medium
CN110457224B (en) Method and device for generating test data
CN109685756A (en) Image feature automatic identifier, system and method
CN113127368A (en) Method, system and medium for generating assembly line
CN106528429A (en) UI testing method and device
CN104850476A (en) Cross-platform interface automated testing method and cross-platform interface automated testing system
US20180217923A1 (en) Method and system for automated testing of a computer program code
CN102135939B (en) Test case operation dispatching device and method
CN107766240A (en) UEFI Shell internal command automatic running detection methods and system
CN107102942B (en) Input domain error positioning-based minimum fault positioning method
CN110262932A (en) Android plate test method, system and computer readable storage medium
CN110990285A (en) UI automation test method and device
US20160041897A1 (en) Generation of automated unit tests for a controller layer system and method
CN111414287A (en) Method, system and device for analyzing chip test result
CN105933700B (en) Detection method, device and the television set of television applications program license
JP2024509721A (en) Test method, system and device by loading Excel (registered trademark) files
CN104572466A (en) Automatic testing method and device
Rendell Effective and pragmatic test driven development

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant