CN106354648A - python automatic test framework system and test method - Google Patents

python automatic test framework system and test method Download PDF

Info

Publication number
CN106354648A
CN106354648A CN201610803458.XA CN201610803458A CN106354648A CN 106354648 A CN106354648 A CN 106354648A CN 201610803458 A CN201610803458 A CN 201610803458A CN 106354648 A CN106354648 A CN 106354648A
Authority
CN
China
Prior art keywords
test
case
testing
environment attribute
script
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.)
Granted
Application number
CN201610803458.XA
Other languages
Chinese (zh)
Other versions
CN106354648B (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 invention provides a python automatic test framework system. The python automatic test framework system comprises a test script functional interface module, a test case loading module, a test control module and a test execution module. The test script functional interface module is used for writing test scripts and setting the environment attributes of test cases corresponding to the test scripts, and the multiple test cases form a case set; the test case loading module is used for loading the selected case set and selecting the test cases needing testing; the test control module is used for setting the current test environment attribute and automatically scanning the environment attributes of the test cases to match the attributes of the test cases with the current test environment attribute; the test execution module is used for executing the test cases designated by the test control module and returning test results to the test control module. Compared with the prior art, by means of the python automatic test framework system, test scripts not matched with the test environment can be automatically neglected, and test scripts matched with the test environment can be automatically executed.

Description

A kind of python automated test frame system and method for testing
Technical field
The present invention relates to software test field, more particularly, to a kind of python automated test frame system and test side Method.
Background technology
With the development of software automated testing technology in recent years, feature be efficient automated test frame technology with excellent The appearance of elegant automated test tool, largely improves the development efficiency of automatic test script, simultaneously also right The requirement more and more higher of the automatic test of software.
In the software automated testing of correlation technique, the test script of same test use cases will build several differences respectively Test environment, when automatized script continuously performs, can because test environment difference lead to test crash, test environment to be broken Bad and test execution is blocked, so that automatic test is loaded down with trivial details, 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 method for testing to solve above-mentioned asking Topic.
Content of the invention
The technical problem to be solved in the invention is to provide automatically to ignore with test environment unmatched test script and hold The python automated test frame system of test script and method of testing that row is matched with test environment.
For solving above-mentioned technical problem, the present invention provides a kind of python automated test frame system, comprising:
Test script functional interface module, is used for writing test script, and arranges the corresponding test of each described test script The environment attribute of use-case, multiple described test cases form set of uses case;
Test case load-on module, for the described set of uses case of loading selected, and needs to execute in selected described set of uses case Described test case;
Testing control module, for arranging preset test environment attribute, and described in automatically scanning, test case concentrates each Then the environment attribute of described test case is compared by the environment attribute of described test case with described test environment attribute Relatively, testing execution module is then notified to execute described test case when described environment attribute and described test environment attribute match Described test script, mismatches and then ignores described test script;
Testing execution module, for executing the described test script that described testing control module is specified, and by test result It is back to described testing control module.
A kind of method of testing of python automated test frame system is provided, comprises the following steps:
Write test script, test script is write by test script functional interface module, and each described test is set The environment attribute of the corresponding test case of script, multiple described test cases form set of uses case;
Load set of uses case the selected described use-case needing implementation of test cases, specifying by the loading of test case load-on module Collection, and select the multiple described test case needing execution;
Judge whether the environment attribute of test case is mated with test environment attribute, described by testing control module setting The preset test environment attribute of testing control module, the environment of test case described in described testing control module automatically scanning belongs to Property, and by the environment attribute of the described test case of scanning and described preset test environment attribute contrast, when described environment attribute Matching with described test environment attribute does not then notify testing execution module to execute the described test script of described test case, not Join, ignore described test script;
Test script executes automatically, the institute being matched with described test environment attribute by the execution of described testing execution module State test case, and test result is returned notice to described testing control module.
Preferably, in the automatic execution step of described test script, described testing control module show in real time testing progress and Test result.
Preferably, described loading set of uses case and selected need in implementation of test cases step, described test case load-on module One described test use cases of single load, select one or more described test cases.
Preferably, in the automatic execution step of described test script, described testing execution module single executes a described survey Example on probation.
Preferably, described write in test script step, described test script is retouched by daily record dispenser and test environment State device to modify.
Compared with correlation technique, the method for testing of the python automated test frame system that the present invention provides includes loading Test case simultaneously identifies two steps of test script of test case environment attribute and implementation of test cases, effectively prevent When python automatized script continuously performs because test environment difference lead to test crash, test environment be destroyed and test Execute obstruction, automatically select the test case meeting test environment and execute, need not other troublesome operation, high degree of automation.
Brief description
Fig. 1 is the structured flowchart of python automated test frame system of the present invention;
Fig. 2 is the flow chart of python automated test frame system method of testing of the present invention.
Specific embodiment
Below in conjunction with drawings and embodiments, the invention will be further described.
Refer to Fig. 1, be the structured flowchart of python automated test frame system of the present invention.Described python automatization Test frame system 100 include test script functional interface module 1, test case load-on module 2, testing control module 3 and Testing execution module 4.
Described test script functional interface module 1 is used for writing test script, and arranges each described test script correspondence The environment attribute of test case, multiple described test cases form set of uses case.
Tester writes described test script according to basic api (advanced programmers interface), And the environment attribute that each described test script corresponds to test case is set, wherein, the species of environment attribute and value can roots Self-defined according to practical situation.Described set of uses case is made up of multiple described test cases, and described test script passes through daily record dispenser Modified with test environment describer, by the modification of setup function, each described test before each described test script execution Script is cleared up function by teardown test environment after running succeeded or failing and is cleared up.
Described test case load-on module 2 is used for loading in the described set of uses case specified and selected described set of uses case to be needed to hold The described test case of row.
Described testing control module 3 is used for arranging preset test environment attribute, and each described test case of automatically scanning Described environment attribute, then the environment attribute of described test case is compared with described test environment attribute, when described Environment attribute and described test environment attribute match, and notify testing execution module 4 to execute the described test of described test case Script, mismatches and then ignores described test script.
Described testing execution module 4 is used for executing the described test case that described testing control module 3 is specified, and will test Result is back to described testing control module 3.
By corresponding test environment attribute is configured to test case each described, then described testing control module 3 from Whether the dynamic environment attribute scanning described test case mates preset test environment attribute, when the environment attribute of described test case Match with described preset test environment and then notify to execute the described test script of described test case, mismatch described in then ignoring The described test script of test case, thus the test environment of different described test cases can effectively be distinguished, makes in automatization no In people's test on duty, tester only needs to arrange current test environment attribute, by the described test script of described set of uses case All execute, described python automated test frame system 100 can automatically be selected and meet the described of described test environment Test case executes, need not other troublesome operation.
Incorporated by reference to reference to Fig. 2, it is the flow chart of python automated test frame system method of testing of the present invention.There is provided one Plant the method for testing of described python automated test frame system 100, comprise the following steps:
Step s1, writes test script, writes test script by test script functional interface module 1, and arranges each The environment attribute of the corresponding test case of described test script, multiple described test cases form set of uses case;
In this step, described test script is modified by daily record dispenser and test environment describer.
Step s2, is loaded set of uses case and selectes and need implementation of test cases, specified by test case load-on module 2 loading Described set of uses case, and select the multiple described test case needing execution;
In this step, described test case load-on module one described test use cases of 2 single load, select one or many Individual described test case.
Step s3, judges whether the environment attribute of test case is mated with test environment attribute, by testing control module 3 The preset test environment attribute of described testing control module 3, test case described in described testing control module 3 automatically scanning are set Environment attribute, and by the environment attribute of the described test case of scanning and the contrast of described preset test environment attribute, when described Environment attribute and described test environment attribute match, and notify testing execution module 4 to execute the described test of described test case Script, mismatches and then ignores described test script;
Step s4, test script executes automatically, by the execution of described testing execution module 4 and described test environment attribute phase The described test case of coupling, and test result is returned notice to described testing control module 3.
In this step, described testing execution module one described test case of 4 single load.Described testing control module 3 Display testing progress and test result, understand testing progress and test result in real time for tester in real time.
Compared with correlation technique, the method for testing of the python automated test frame system of the present invention includes loading test Use-case simultaneously identifies test script two step of test case environment and implementation of test cases, effectively prevent python automatization foot When originally continuously performing because test environment difference lead to test crash, test environment be destroyed and test execution block, automatically Select the test case meeting test environment and execute, need not other troublesome operation, high degree of automation.
The foregoing is only embodiments of the invention, not thereby limit the present invention the scope of the claims, every using this Equivalent structure or equivalent flow conversion that bright description and accompanying drawing content are made, or directly or indirectly it is used in the skills of other correlations Art field, is included within the scope of the present invention.

Claims (6)

1. a kind of python automated test frame system is it is characterised in that include:
Test script functional interface module, is used for writing test script, and arranges each described test script correspondence test case Environment attribute, multiple described test cases form sets of uses case;
Test case load-on module, for the described set of uses case of loading selected, and selectes the institute needing in described set of uses case to execute State test case;
Testing control module, for arranging preset test environment attribute, and each described test in set of uses case described in automatically scanning Then the environment attribute of described test case is compared, when described by the environment attribute of use-case with described test environment attribute Environment attribute and described test environment attribute match and then notify testing execution module to execute the described test of described test case Script, mismatches and then ignores described test script;
Testing execution module, for executing the described test script that described testing control module is specified, and test result is returned To described testing control module.
2. a kind of method of testing of python automated test frame system is it is characterised in that comprise the following steps:
Write test script, test script is write by test script functional interface module, and each described test script is set The environment attribute of corresponding test case, multiple described test cases form set of uses case;
Load set of uses case the selected described set of uses case needing implementation of test cases, specifying by the loading of test case load-on module, And select the multiple described test case needing execution;
Judge whether the environment attribute of test case is mated with test environment attribute, described test is arranged by testing control module The preset test environment attribute of control module, the environment attribute of test case described in described testing control module automatically scanning, and By the environment attribute of the described test case of scanning and the contrast of described preset test environment attribute, when described environment attribute with described Test environment attribute matches and then notifies testing execution module to execute the described test script of described test case, mismatches and then neglects Slightly described test script;
Test script executes automatically, the described survey being matched with described test environment attribute by the execution of described testing execution module Example on probation, and test result is returned notice to described testing control module.
3. the method for testing of python automated test frame system according to claim 2 is it is characterised in that described survey In this automatic execution step of training, described testing control module shows testing progress and test result in real time.
4. the method for testing of python automated test frame system according to claim 2 is it is characterised in that described add Carry set of uses case and select and need in implementation of test cases step, described test case load-on module single load one described test use Example collection, selectes one or more described test cases.
5. the method for testing of python automated test frame system according to claim 2 is it is characterised in that described survey In this automatic execution step of training, described testing execution module single executes a described test case.
6. the method for testing of python automated test frame system according to claim 2 is it is characterised in that described volume Write in test script step, described test script passes through daily record dispenser and test environment describer is modified.
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 true CN106354648A (en) 2017-01-25
CN106354648B 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)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107797930A (en) * 2017-10-27 2018-03-13 东信和平科技股份有限公司 Method, system, device and the readable storage medium storing program for executing of testing smart card function
CN107844426A (en) * 2017-11-24 2018-03-27 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN108959080A (en) * 2018-06-27 2018-12-07 郑州云海信息技术有限公司 A kind of automated testing method executed parallel based on UnitTest
CN109240923A (en) * 2018-08-31 2019-01-18 福建天泉教育科技有限公司 The generation method and computer readable storage medium of interface testing script
CN109739769A (en) * 2019-01-02 2019-05-10 深圳忆联信息***有限公司 BOOTROM loads method for automatically testing functions 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
CN113238953A (en) * 2021-05-26 2021-08-10 杭州安恒信息技术股份有限公司 UI automation test method and device, electronic equipment and storage medium
CN113407440A (en) * 2021-05-24 2021-09-17 深圳市广和通无线股份有限公司 System and method for testing wireless communication module

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100095276A1 (en) * 2008-10-09 2010-04-15 Accenture S.A. Test data creation and execution system for service oriented architecture
US20150007148A1 (en) * 2013-02-28 2015-01-01 International Business Machines Corporation Identifying Test Cases Based on Changed Test Code
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100095276A1 (en) * 2008-10-09 2010-04-15 Accenture S.A. Test data creation and execution system for service oriented architecture
US20150007148A1 (en) * 2013-02-28 2015-01-01 International Business Machines Corporation Identifying Test Cases Based on Changed Test Code
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

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107797930A (en) * 2017-10-27 2018-03-13 东信和平科技股份有限公司 Method, system, device and the readable storage medium storing program for executing of testing smart card function
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
CN108959080A (en) * 2018-06-27 2018-12-07 郑州云海信息技术有限公司 A kind of automated testing method executed parallel based on UnitTest
CN109240923A (en) * 2018-08-31 2019-01-18 福建天泉教育科技有限公司 The generation method and computer readable storage medium of interface testing script
CN109240923B (en) * 2018-08-31 2021-06-04 福建天泉教育科技有限公司 Interface test script generation method and computer readable storage medium
CN109739769A (en) * 2019-01-02 2019-05-10 深圳忆联信息***有限公司 BOOTROM loads method for automatically testing functions 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
CN113407440A (en) * 2021-05-24 2021-09-17 深圳市广和通无线股份有限公司 System and method for testing wireless communication module
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

Also Published As

Publication number Publication date
CN106354648B (en) 2019-01-22

Similar Documents

Publication Publication Date Title
CN106354648A (en) python automatic test framework system and test method
CN106095677B (en) The RESTful Webservice automatic interface testing methods realized based on Robot Framework
CN105608258B (en) A kind of Model-based diagnosis and information flow visual simulation system and method
CN102495789B (en) Automatic test method and device for the same
EP1657634A2 (en) Test agent architecture
CN105760296B (en) Automatic test control method, device and terminal
CN102595184B (en) Intelligent television automation test method and system
CN105895004B (en) Display panel drive method and device
CN101706753A (en) Unit testing framework and method based on Perl
CN106155884A (en) A kind of log analysis method and system
CN104899132B (en) Application software testing method, apparatus and system
CN110580187B (en) Method and terminal for realizing online learning course
CN109710301A (en) A kind of method and terminal of automatic relatively interface document difference
CN104978271A (en) Automatic upgrade pressure measurement method and system for Android system
CN104199770B (en) A kind of automated testing method of mobile phone music APK
CN106528429A (en) UI testing method and device
US20180217923A1 (en) Method and system for automated testing of a computer program code
CN104850476A (en) Cross-platform interface automated testing method and cross-platform interface automated testing system
CN102135939B (en) Test case operation dispatching device and method
CN110262932A (en) Android plate test method, system and computer readable storage medium
CN105740147A (en) Method for automatically testing interfaces of intelligent terminals
CN105204994B (en) A kind of automated testing method and system
CN109885390A (en) Molecular docking cloud computing flow control method
CN111444109A (en) Mobile terminal UI automatic testing method and system
CN102043628A (en) Method and system for developing on screen display (OSD) application software and multimedia terminal

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