CN107957948A - A kind of user interface automatic test device and method - Google Patents

A kind of user interface automatic test device and method Download PDF

Info

Publication number
CN107957948A
CN107957948A CN201711286936.5A CN201711286936A CN107957948A CN 107957948 A CN107957948 A CN 107957948A CN 201711286936 A CN201711286936 A CN 201711286936A CN 107957948 A CN107957948 A CN 107957948A
Authority
CN
China
Prior art keywords
test
testing
user interface
module
control
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.)
Pending
Application number
CN201711286936.5A
Other languages
Chinese (zh)
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201711286936.5A priority Critical patent/CN107957948A/en
Publication of CN107957948A publication Critical patent/CN107957948A/en
Pending legal-status Critical Current

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

Abstract

The present invention provides a kind of user interface automatic test device and method, including test case module, testing control module and testing tool module;The test case module is used to write dependence test use-case according to ui testing content design and create ui testing object retrieval table, the retrieval table of the test object is stored in database, is accessed for testing control module and testing tool module to retrieval table reading;The testing control module is used for database manipulation, the processing of test data and the transmission of test data in control user interface automatic test process;The testing tool module is used to perform automatic test task, and interacting for test data is carried out with testing control module.

Description

A kind of user interface automatic test device and method
Technical field
The present invention relates to automatic test field, specifically a kind of user interface automatic test device and method.
Background technology
Whether the various functions that ui testing (UI tests) is used for testing user interface are up to standard, the function of user interface Standard includes:Whether whether the reasonable, placement location of whether consistent, each control of whole style meets visitor to the layout of function module Family use habit etc..
The automatic test of user interface, is exactly to be operated by the UI of the machine simulation mankind, the test process automated. UI automatic tests are more using the localization method such as id, name, class name, and since interface variation is more frequent, and front end is deposited In substantial amounts of element operation, corresponding needs substantial amounts of operation code to be safeguarded.Automation software testing is soft Proportion in part product test gradually increases, show automatic test software test heighten efficiency it is cost-effective on it is important Property.But in the automatic test of all kinds, UI automatic tests be it is most unstable, what test case was most difficult to write, safeguard into This highest mode.
The trickle change of a user interface node in the prior art, may cause automation tools not identify that UI is controlled Part, then all test cases for using this control are required for updating, and search and replace and ensure that it is exactly one not replace mistake A very big workload.The localization and expression formula of same element is different, and many places in test script may be caused to change, even resulted in The omission of part change, makes the maintenance of test script become to take time and effort.Therefore how automatic test carries out efficient user circle Face automatic test is urgent problem.
The content of the invention
To solve the above-mentioned problems, the present invention provides a kind of user interface automatic test device and method, to user Interface is tested with carrying out high efficient and reliable.
The technical assignment of the present invention is realized in the following manner:
An embodiment of the present invention provides a kind of user interface automatic test device, including test case module, test control Molding block and testing tool module;The test case module is used to write dependence test according to ui testing content design Use-case simultaneously creates ui testing object retrieval table, and the retrieval table of the test object is stored in database, for testing Control module and testing tool module access retrieval table reading;The testing control module is used for control user interface certainly The processing of database manipulation, test data and the transmission of test data in dynamicization test process;The testing tool module For performing automatic test task, interacting for test data is carried out with testing control module.
Further, the test case module writes unit, test request generation unit, retrieval table including test case Setting unit;The test case is write unit and is used for according to user interface automatic test actual demand, writes design test Use-case;The test request generation unit is used for the test request for generating user interface;The retrieval table setting unit is used to give birth to Into the retrieval table of simultaneously managing user interface test object.
Further, test case, which writes unit and can carry out layering to test script, writes, and is written as interface element rope Draw layer, interface element positioning package layer, elemental basis operation encapsulated layer, testing procedure and write layer, wherein the interface element Index level, an interface element index database is separately stored as by the localization and expression formula of interface element;The interface element positioning Page elements are positioned and encapsulated according to Interface classification by encapsulated layer;The elemental basis operation encapsulated layer, realizes interface The basic operation of element;The testing procedure writes layer, and the basic operation to interface element carries out assembling combination.
Further, the testing control module includes unit of testing and controlling, continuous integrating unit, data-reading unit; The unit of testing and controlling is used for the transmission and processing for controlling test data;The continuous integrating unit is used for that will test generation Code focuses on trunk test program, completes the compiling of automation caller project, packing and test;The data-reading unit For reading the retrieval table of ui testing object.
Further, the continuous integrating unit periodically goes on svn to obtain new generation by jenkins continuous integrating instruments Code, automatic test code is performed by ant instruments.
Further, testing tool module includes driving script unit, testing execution module and page control module;It is described Driving script unit is used for the driving script for providing user interface automatic test;The testing execution module is used to perform user The automatic test of the page or control in interface;The page control module is used to retrieving and handling the member of the page in user interface Element or control element.
The embodiment of the present invention additionally provides a kind of user interface automated testing method, and the method includes following step Suddenly:
S1, test case module write design test case and create test object retrieval table according to testing requirement;
S2, the generation ui testing request of test case module, testing control module control retrieval table Relational database Operation, the processing of test data and the transmission of test data;
S3, testing tool module perform automatic test task, by retrieving the page elements in table test user interface Or control element;
S4, testing tool module feedback test result, exports test report.
Further, test object retrieval table is created in step S1 and refers to establish page iden-tity in user interface, control mark Know the correspondence between the description information data of control and generate retrieval table, afterwards again by testing control module and test work Tool module accesses retrieval table reading, and the test object found in user interface is tested.
Further, pair in the user interface between page iden-tity, control mark and the description information data of control It should be related to and be stored with control tree construction.
The beneficial effects of the invention are as follows:
1st, the present invention chooses test case module, testing control module and test in the automatic test of user interface Tool model implements test so that test script mapping management by different level, clear, easy to safeguarding.
2nd, the present invention proposes the automated testing method based on zonal testing object retrieval table, and exception is carried out to control Reason, reduces the duplicated code in automatic test, improves testing efficiency, improves the stability in automatic test.
Brief description of the drawings
Fig. 1 is the schematic diagram of apparatus of the present invention embodiment;
Fig. 2 is the flow chart of the method for the present invention embodiment.
Embodiment
Below in conjunction with the attached drawing embodiment that the present invention will be described in detail, following disclosure provides embodiment For realizing the device of the invention and method, those skilled in the art is set to be more clearly understood that how to realize the present invention.In order to Simplify disclosure of the invention, hereinafter the component and setting of specific examples are described.In addition, the present invention can be in different examples Repeat reference numerals or letter in son.This repetition is for purposes of simplicity and clarity, itself not indicate discussed various Relation between embodiment or setting.It should be noted that illustrated component is not drawn necessarily to scale in the accompanying drawings.The present invention saves The description to known assemblies and treatment technology and process has been omited to avoid the present invention is unnecessarily limiting.It will be appreciated that though this Invention describes its preferred embodiment, but these simply elaborations to embodiment, rather than limitation are of the invention Scope.
Embodiment
As shown in Figure 1, an embodiment of the present invention provides a kind of user interface automatic test device, the device includes Test case module, testing control module and testing tool module;The test case module is used for according to ui testing Content design writes dependence test use-case and creates ui testing object retrieval table, the retrieval table storage of the test object In database, access for testing control module and testing tool module to retrieval table reading;The testing and control mould Block is used for database manipulation, the processing of test data and the biography of test data in control user interface automatic test process It is defeated;The testing tool module is used to perform automatic test task, and interacting for test data is carried out with testing control module.
The Test Sample Design of user interface be exactly several different test points in a test case are split and The testing procedure of its a single point is encapsulated, forms a module.Such as:One test case will be to a login journey Sequence is tested, including:User name input, Password Input and definite login;User name can so be inputted, Password Input, determine that login, cancellation log in four operations and be individually enclosed in four different modules.During test, only need to call Its module.Like this, when a module changes, you only need to separately maintain that module, can also be according to mould The various combination of block is into different test cases.
Retrieval table is a kind of data of user oriented interface object, such as:In QTP, RFT, object can be a data Or a retrieval table, its test object, can be encapsulated as a retrieval table by the crawl to object, you can with by gui elements Retrieval table one by one has been packaged into, various to the progress of its key object can so have been operated, different objects can drive not Same test flow direction and result.
The mode simply applied can use an EXCEL table, and the inside includes " object type " Object Name, and " object is grasped Make title " " judgment mode " " expected results ".Like this, can be by importing different user interface object type and name Claim, different Object Operations have been built into a test case table.
Test case module writes unit, test request generation unit, retrieval table setting unit including test case;It is described Test case is write unit and is used for according to user interface automatic test actual demand, writes design test case;The test Request to generate the test request that unit is used to generate user interface;The retrieval table setting unit is used to generate and manage user circle The retrieval table of face test object.
Test Engineer carries out testing example design, generates the test using retrieval table as driving and use according to testing requirement Example table, deposits in database, is accessed easy to control module and third party's automated test tool.
Control module is responsible for operation, test data processing and transmission data control to database.Control module include but It is not limited to read data from database, driving third party instrument reads retrieval table table, driving test script execution etc.;Control system System includes control module, reads retrieval table table module and navigation script module.Wherein control module is transparent for tester, For background module, it is responsible for the Data Transmission Controlling of whole frame, such as drives third party's automated test tool script to read and close Key word table, access database.Test script is responsible for establishing the tree structure of test retrieval table table, easy to later retrieval table script Maintenance.
The continuous integrating unit periodically goes to obtain fresh code on svn, passes through ant by jenkins continuous integrating instruments Instrument performs automatic test code.
Testing tool module performs automatic test task according to retrieval table, can carry out layering to test script and write, It is written as interface element index level, interface element positioning package layer, elemental basis operation encapsulated layer, testing procedure and writes layer, its Described in interface element index level, the localization and expression formula of interface element is separately stored as an interface element index database;Institute Page elements are positioned and encapsulated according to Interface classification by the interface element positioning package layer stated;The elemental basis behaviour Make encapsulated layer, realize the basic operation of interface element;The testing procedure writes layer, and the basic operation to interface element carries out Assembling combination simultaneously completes testing procedure.
For example, writing web page element index database, the localization and expression formula of element needed for web page operation is obtained, it may include id is fixed Position, css positioning or Xpath positioning.All localization and expression formulas are stored in unified text document and facilitate superstructure tune With.The mode of " element term-localization and expression formula type-specific localization and expression formula " can be used in text formatting, indicates what is used The particular content of positioning method and localization and expression formula.
On the basis of web page element index database has been write, classify by page difference to element, and use testing tool The positioning command of actual use positions element, each page saves as a single program file, is positioned in file The element used in all pages facilitates upper strata to call as public variable., will be right after completing web page element positioning package layer The common operating unit of web page element carries out writing encapsulation.Each action is encapsulated as a single program file, act with Common operation minimum degree is divided, such as click keys, is emptied and inputted the web page operations such as text.Write the action of completion Called as public method for upper strata.
Perform script is simultaneously tested:By test case perform script, each use-case corresponds to and uses a testing procedure Write the program file of layer.
As shown in Fig. 2, the embodiment of the present invention also provides a kind of user interface automated testing method, the method includes Following steps:
S1, test case module write design test case and create test object retrieval table according to testing requirement.
S2, the generation ui testing request of test case module, testing control module control retrieval table Relational database Operation, the processing of test data and the transmission of test data.
S3, testing tool module perform automatic test task, by retrieving the page elements in table test user interface Or control element.
S4, testing tool module feedback test result, exports test report.
Test object retrieval table is created in step S1 and refers to establish page iden-tity in user interface, control mark and control Correspondence between description information data simultaneously generates retrieval table, afterwards again by testing control module and testing tool module to inspection Rope table accesses reading, and the test object found in user interface is tested.
Correspondence between page iden-tity in the user interface, control mark and the description information data of control be with Control tree construction is stored.
In addition, the application range of the present invention is not limited to technique, mechanism, the system of the specific embodiment described in specification Make, material composition, means, method and step., will be easy as those of ordinary skill in the art from the disclosure Ground understands, for current technique that is existing or will developing later, mechanism, manufacture, material composition, means, method or Step, the knot that wherein they perform the function being substantially the same with the corresponding embodiment of the invention described or acquisition is substantially the same Fruit, can apply them according to the present invention.Therefore, appended claims of the present invention are intended to these techniques, mechanism, system Make, material composition, means, method or step are included in its protection domain.

Claims (9)

1. a kind of user interface automatic test device, it is characterized in that, including test case module, testing control module and test Tool model, the test case module are used to write dependence test use-case according to ui testing content design and create use Family interface detection object retrieval table, the retrieval table of the test object is stored in database, for testing control module and survey Examination tool model accesses retrieval table reading;The testing control module is used for control user interface automatic test process In database manipulation, the processing of test data and the transmission of test data;The testing tool module is used to perform automatic Change test assignment, interacting for test data is carried out with testing control module.
2. a kind of user interface automatic test device according to claim 1, it is characterized in that, the test case module Unit, test request generation unit, retrieval table setting unit are write including test case, the test case is write unit and is used for According to user interface automatic test actual demand, design test case is write;The test request generation unit is used to generate The test request of user interface;The retrieval table setting unit is used to generate and the retrieval table of managing user interface test object.
3. a kind of user interface automatic test device according to claim 2, it is characterized in that, test case writes unit Layer is write including interface element index level, interface element positioning package layer, elemental basis operation encapsulated layer, testing procedure, wherein The interface element index level, an interface element index database is separately stored as by the localization and expression formula of interface element;It is described Interface element positioning package layer, page elements are positioned and encapsulated according to Interface classification;The elemental basis operation Encapsulated layer, realizes the basic operation of interface element;The testing procedure writes layer, the basic operation to user interface element into Row assembling combination.
4. a kind of user interface automatic test device according to claim 1, it is characterized in that, the testing control module Including unit of testing and controlling, continuous integrating unit, data-reading unit, the unit of testing and controlling is used to control test data Transmission and processing;The continuous integrating unit is used to, test code is focused on trunk test program, complete automation and adjust With the compiling of procedural item, packing and test;The data-reading unit is used for the retrieval table for reading ui testing object.
5. a kind of user interface automatic test device according to claim 4, it is characterized in that, the continuous integrating unit By jenkins continuous integrating instruments, periodically go to obtain fresh code on svn, automatic test code is performed by ant instruments.
6. a kind of user interface automatic test device according to claim 1, it is characterized in that, testing tool module includes Drive script unit, testing execution module and page control module;
The driving script unit is used for the driving script for providing user interface automatic test;
The testing execution module is used to perform the automatic test of the page or control in user interface;
The page control module is used to retrieve and handle the page elements in user interface or control element.
7. a kind of user interface automated testing method, it is characterized in that, the method comprises the following steps:
S1, test case module write design test case and create test object retrieval table according to testing requirement;
S2, the generation ui testing request of test case module, the operation of testing control module control retrieval table Relational database, The processing of test data and the transmission of test data;
S3, testing tool module perform automatic test task, by retrieving page elements or control in table test user interface Part element;
S4, testing tool module feedback test result, exports test report.
8. a kind of user interface automated testing method according to claim 7, it is characterized in that, test is created in step S1 Object retrieval table refers to establish the corresponding pass between page iden-tity in user interface, control mark and the description information data of control It is and generates retrieval table, then accessed by testing control module and testing tool module to retrieval table reading, finds user circle Test object in face is tested.
9. a kind of user interface automated testing method according to claim 8, it is characterized in that, page in the user interface Correspondence between face mark, control mark and the description information data of control is stored with control tree construction.
CN201711286936.5A 2017-12-07 2017-12-07 A kind of user interface automatic test device and method Pending CN107957948A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711286936.5A CN107957948A (en) 2017-12-07 2017-12-07 A kind of user interface automatic test device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711286936.5A CN107957948A (en) 2017-12-07 2017-12-07 A kind of user interface automatic test device and method

Publications (1)

Publication Number Publication Date
CN107957948A true CN107957948A (en) 2018-04-24

Family

ID=61957551

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711286936.5A Pending CN107957948A (en) 2017-12-07 2017-12-07 A kind of user interface automatic test device and method

Country Status (1)

Country Link
CN (1) CN107957948A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897684A (en) * 2018-06-28 2018-11-27 郑州云海信息技术有限公司 A kind of feed-back type webpage automatic test script design method based on TestNG
CN110347585A (en) * 2019-05-28 2019-10-18 成都美美臣科技有限公司 A kind of UI automatic test image identification method
CN110618934A (en) * 2019-08-15 2019-12-27 重庆金融资产交易所有限责任公司 Front-end automatic test debugging method and device and computer readable storage medium
CN110727603A (en) * 2019-10-25 2020-01-24 重庆誉存大数据科技有限公司 Improved method for automatically testing positioning elements based on UI (user interface)
CN110737573A (en) * 2018-07-18 2020-01-31 北京奇虎科技有限公司 Method and device for automatically testing user interface UI
CN111930635A (en) * 2020-09-17 2020-11-13 深圳微品致远信息科技有限公司 Swagger-based rapid automatic testing method and system
CN112732579A (en) * 2021-01-11 2021-04-30 深圳市瑞云科技有限公司 WebUI automatic test method and system
CN113778898A (en) * 2021-09-26 2021-12-10 杭州安恒信息技术股份有限公司 User interface automatic testing method and device, electronic equipment and storage medium
CN114090155A (en) * 2021-11-17 2022-02-25 中国建设银行股份有限公司 Robot process automation interface element positioning method and device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090249297A1 (en) * 2008-03-25 2009-10-01 Lehman Brothers Inc. Method and System for Automated Testing of Computer Applications
CN105608012A (en) * 2016-03-10 2016-05-25 武汉斗鱼网络科技有限公司 Automatic test method and automatic test system
CN106354649A (en) * 2016-09-18 2017-01-25 郑州云海信息技术有限公司 Layered script design method for automated testing of webpages
CN106649090A (en) * 2016-10-10 2017-05-10 上海瀚之友信息技术服务有限公司 Automated test system and method
CN107133177A (en) * 2017-05-12 2017-09-05 郑州云海信息技术有限公司 A kind of automated test frame

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090249297A1 (en) * 2008-03-25 2009-10-01 Lehman Brothers Inc. Method and System for Automated Testing of Computer Applications
CN105608012A (en) * 2016-03-10 2016-05-25 武汉斗鱼网络科技有限公司 Automatic test method and automatic test system
CN106354649A (en) * 2016-09-18 2017-01-25 郑州云海信息技术有限公司 Layered script design method for automated testing of webpages
CN106649090A (en) * 2016-10-10 2017-05-10 上海瀚之友信息技术服务有限公司 Automated test system and method
CN107133177A (en) * 2017-05-12 2017-09-05 郑州云海信息技术有限公司 A kind of automated test frame

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897684A (en) * 2018-06-28 2018-11-27 郑州云海信息技术有限公司 A kind of feed-back type webpage automatic test script design method based on TestNG
CN110737573A (en) * 2018-07-18 2020-01-31 北京奇虎科技有限公司 Method and device for automatically testing user interface UI
CN110737573B (en) * 2018-07-18 2023-02-17 北京奇虎科技有限公司 Method and device for automatically testing user interface UI
CN110347585A (en) * 2019-05-28 2019-10-18 成都美美臣科技有限公司 A kind of UI automatic test image identification method
CN110618934A (en) * 2019-08-15 2019-12-27 重庆金融资产交易所有限责任公司 Front-end automatic test debugging method and device and computer readable storage medium
CN110727603A (en) * 2019-10-25 2020-01-24 重庆誉存大数据科技有限公司 Improved method for automatically testing positioning elements based on UI (user interface)
CN111930635A (en) * 2020-09-17 2020-11-13 深圳微品致远信息科技有限公司 Swagger-based rapid automatic testing method and system
CN112732579A (en) * 2021-01-11 2021-04-30 深圳市瑞云科技有限公司 WebUI automatic test method and system
CN112732579B (en) * 2021-01-11 2023-05-02 深圳市瑞云科技有限公司 Automatic test method and system for WebUI
CN113778898A (en) * 2021-09-26 2021-12-10 杭州安恒信息技术股份有限公司 User interface automatic testing method and device, electronic equipment and storage medium
CN113778898B (en) * 2021-09-26 2024-02-20 杭州安恒信息技术股份有限公司 User interface automatic test method and device, electronic equipment and storage medium
CN114090155A (en) * 2021-11-17 2022-02-25 中国建设银行股份有限公司 Robot process automation interface element positioning method and device and storage medium

Similar Documents

Publication Publication Date Title
CN107957948A (en) A kind of user interface automatic test device and method
CN106649100B (en) Automatic testing method and system
JP4827834B2 (en) Method and apparatus for modifying process control data
US9104810B2 (en) Creating a test case
CN101661460B (en) Method and device for generating management system report
US6507842B1 (en) System and method for importing and exporting test executive values from or to a database
CN107133177A (en) A kind of automated test frame
CN109783084A (en) A kind of computer code automatic generation method, system, device and storage medium
CN105912473B (en) Mobile APP automatically testing platform and test method based on BDD
CN107179753A (en) Automation control system point configuration from director demon file
CN107729230A (en) A kind of WEB automatic test devices and method of testing based under control scheme
CN105335412A (en) Method and device for data conversion and data migration
CN103425584A (en) Large-scale application regression testing information processing method based on Java bytecode
CN103810275A (en) Method and device for data interaction between non-relation type database and relation type database
CN110297752A (en) Acquisition methods and device, automatization test system, the storage medium of control element
Bischofberger et al. Sotograph–a pragmatic approach to source code architecture conformance checking
CN110334169B (en) Novel geographical calculation device
US10095678B2 (en) Database user interfaces with flowsheets of a simulation system
CN106469215B (en) Data lead-in method and system based on page end
CN105045817B (en) SQL Server database evidence-taking and analysis system and method based on transaction journal
US20070083543A1 (en) XML schema template builder
CN108681556A (en) The access method and its system of distributed instruction numeric field data
CN102629204A (en) Generating method and device for webpage source code
CN103984769A (en) Use-case data management and storage method
CN107015903A (en) A kind of generation method, device and the electronic equipment of interface detection program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180424