CN114218105A - UI automatic regression testing system based on configuration application mode - Google Patents
UI automatic regression testing system based on configuration application mode Download PDFInfo
- Publication number
- CN114218105A CN114218105A CN202111544289.XA CN202111544289A CN114218105A CN 114218105 A CN114218105 A CN 114218105A CN 202111544289 A CN202111544289 A CN 202111544289A CN 114218105 A CN114218105 A CN 114218105A
- Authority
- CN
- China
- Prior art keywords
- page
- test
- case
- unit
- page element
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/186—Templates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
Abstract
The invention discloses a UI (user interface) automatic regression testing system based on a configuration, namely an application mode, which comprises a page element configuration unit, a page element analysis unit and a page element analysis unit, wherein the page element configuration unit is used for configuring all page elements in a UI interface according to the identification modes of the page elements; the operation mode configuration unit is used for selecting the page elements and configuring corresponding operation modes for the page elements; the case set assembling unit is used for assembling to obtain a case set; the test file generation unit is used for filling the page elements and the corresponding operation modes thereof into a preset packaging template to generate unit test case codes and a uniform case entry file; and the report generating unit is used for generating the test report in the HTML format. According to the invention, the page elements, the operation mode and the test cases are configured by adopting the graphical interface, and the unit case codes and the unified case entry files are automatically generated based on the mode of configuration, namely application, so that the use is convenient and fast, and the efficiency is improved.
Description
Technical Field
The invention relates to the technical field of software application automatic testing, in particular to a UI automatic regression testing system based on a configuration, namely an application mode.
Background
Before the software application is released, a large amount of tests are required to ensure that the software application can run perfectly. Wherein after the old code is modified, a new test is required to confirm that the modification does not introduce new errors or cause errors in other code, which is called a regression test.
The traditional testing method is to write test cases manually for testing, and in order to improve efficiency, various automatic testing tools appear, for example: selenium, used for WEB automation testing; the AppIU is used for App automatic testing; jmeter for interface test and performance test; and the Robot Framework is used for WebUI automatic test, interface test and the like. However, the existing automatic test tools need to write test cases manually, and are difficult to use and maintain.
In view of this, it is urgently needed to improve the existing UI automated regression testing system to automatically generate test cases and test files according to the page element configuration and operation mode, thereby improving efficiency and convenience of use.
Disclosure of Invention
In view of the above defects, the technical problem to be solved by the present invention is to provide a UI automated regression testing system and system based on a configuration, i.e. an application mode, so as to solve the problem that the existing UI automated regression testing system needs to manually compile test cases and is difficult to use and maintain.
Therefore, the invention provides a UI automatic regression testing system based on a configuration mode, which comprises:
the page element configuration unit is used for configuring and configuring all page elements in the UI according to the identification mode of the page elements;
the operation mode configuration unit is used for selecting the page elements and configuring corresponding operation modes for the page elements, each page element and the corresponding operation mode form an operation, and a plurality of operations are assembled into a test case;
the case set assembling unit is used for selecting a plurality of corresponding test cases according to the business process, setting the execution sequence of the corresponding test cases and assembling to obtain a case set;
the test file generation unit is used for filling the page elements and the corresponding operation modes of the page elements in each test case in the case set into a preset packaging template to generate unittest case codes and generating a uniform case entry file by using discovery, wherein the unittest case codes and the case entry file form a complete test file;
and the report generating unit is used for generating a test report in an HTML format from a test result obtained by operating the test file.
In the above system, preferably, the page element configuration unit obtains the id and name of the control in the page element through an microsoft control recognition tool, instect, in the windows page, and the web page obtains Xpath, name, and class of the control in the page element by using a browser with an F12 tool.
In the above system, preferably, the report generating unit employs an enterprise wechat robot to notify the test result in real time within a business group.
In the above system, preferably, the report generating unit stores the execution record of the test file and the test result in a system database, and also stores a test log file.
In the above system, preferably, the page element configuration unit obtains the id and name of the control in the page element through an microsoft control recognition tool, instect, in the windows page, and the web page obtains Xpath, name, and class of the control in the page element by using a browser with an F12 tool.
In the above system, preferably, the page element configuration unit configures the identification manner of the page element by applying a page element configuration table in a user-defined manner.
According to the technical scheme, the UI automatic regression testing system based on the configuration mode, namely the application mode, solves the problems that an existing system needs to manually compile test cases, and is difficult to use and maintain. Compared with the prior art, the invention has the following beneficial effects:
the identification mode, the operation mode and the test case of the page elements are configured by adopting the graphical interface, and the unit case codes and the unified case entry file are automatically generated based on the configuration, namely the application mode, so that the use is convenient and quick, and the efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments of the present invention or the prior art will be briefly described and explained. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
FIG. 1 is a schematic diagram of an automated regression testing system for UI based on a configuration mode;
FIG. 2 is a schematic diagram of the arrangement of page elements in the present invention;
FIG. 3 is a diagram illustrating an operation mode corresponding to a selected page element configuration according to the present invention;
FIG. 4 is a diagram illustrating the assembly of test case sets according to the present invention;
FIG. 5 is an exemplary diagram of a test report in the present invention;
FIG. 6 is an exemplary diagram of a desktop client displaying test files and related information of a project according to the present invention.
Detailed Description
The technical solutions of the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings, and it is to be understood that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without any inventive step, are within the scope of the present invention.
The realization principle of the invention is as follows: the page elements, the operation mode and the test cases are configured by adopting the graphical interface, and the unit case codes and the unified case entry files are automatically generated based on the configuration, namely the application mode, so that the use is convenient and quick, and the efficiency is improved.
In order to make the technical solution and implementation of the present invention more clearly explained and illustrated, several preferred embodiments for implementing the technical solution of the present invention are described below.
It should be noted that the terms of orientation such as "inside, outside", "front, back" and "left and right" are used herein as reference objects, and it is obvious that the use of the corresponding terms of orientation does not limit the scope of protection of the present invention.
Referring to fig. 1, fig. 1 is a schematic diagram of an automated UI regression testing system based on a configuration mode.
As shown in fig. 1, the UI automated regression testing system based on configuration, i.e. application mode, provided by the present invention includes a page element configuration unit 10, an operation mode configuration unit 20, a use case assembly unit 30, a test file generation unit 40, and a report generation unit 50.
The page element configuration unit 10 is configured to configure all page elements in the UI interface according to the identification manner of the page elements. The identification of the page elements supports positioning modes such as Xapth, name, class and the like.
For example: the page element configuration unit obtains the id and the name of a control in a page element through an INSPECT (INSPECT) tool in a windows page, and the Xpath, the name and the class of the control in the page element are obtained by a browser with an F12 tool.
The process of configuring UI foreground interface page elements is illustrated in fig. 2, for example:
the configured page element is a login window, the element control type is Windows control, the element positioning type is AutomationId, and the element attribute value is FirmLogin.
The page element configuration unit 10 can add and delete page elements, and modify, edit and store the page elements. The UI foreground interface page element configuration is saved in a system database.
The operation mode configuration unit 20 is configured to select a page element and configure a corresponding operation mode. The operation mode is used for simulating operations of clicking, inputting, screen switching, waiting for loading and the like of a user. Each page element and the corresponding operation mode form an operation, and a plurality of operations are assembled into a test case.
Selecting a page element on the UI and configuring the corresponding mode of operation is illustrated in fig. 3. For example: for 'click to login', the page element is a login window and the operation mode is click.
In the invention, the operation mode of the page element adopts python + uiautomator2 for secondary packaging, and the operation mode is used for secondary packaging.
The case set assembling unit 30 is configured to select a corresponding test case according to the service flow, set an execution sequence of each test case, and assemble the test cases to obtain a case set.
As shown in FIG. 4, the social security group management case set includes the following test cases, and the sequence numbers 0-5 represent the execution sequence of the test cases:
0, login success verification;
1, opening social security combination verification;
2, verifying the combined comprehensive information;
3, verifying batch cash flow information;
4, validating the traffic flow information;
and 5, verifying circulation limited asset information.
Test cases may be added or deleted in the use case set assembling unit 30.
The test file generating unit 40 is configured to fill the page elements and the corresponding operation modes in each test case in the case set into the Template through a preset package Template to generate a unittest case code of Python. And generating a unified use case entry file by using a self-defined discovery method. The unittest use case code and the use case entry file form a complete test file.
The invention realizes the automatic generation of the case codes by using the self-defined following page element configuration table, the desktop application page table, the desktop case execution record table, the desktop test case step table and the desktop test case set table and by using the packaging template.
Table 1: desktop application page element configuration table t _ threads.
Table 2: desktop application page table t _ winpages
Table 3: desktop case execution record table t _ winrecords
Table 4: desktop test case table t _ wintestcase
Table 5: desktop test case step table t _ winteststep
Table 6: desktop test case set table t _ wintestsuite
Specifically, in each configuration page, each configuration operation is parsed and stored in the corresponding table. For example:
according to the configuration operation of the page elements on the page element configuration interface, acquiring corresponding page elements by utilizing positioning modes such as Xapth, name, class and the like, and storing the corresponding page elements in a page element configuration table;
storing the corresponding page elements and the operation modes in a desktop application page table according to the configuration operation on the page element and operation mode configuration interface, wherein the page elements are obtained from the page element configuration table;
storing the test cases and the execution steps thereof in a desktop case execution record table, a desktop test case table and a desktop test case step table according to the operation on the test case configuration page, wherein the test case configuration is obtained from a desktop application page table;
and storing the combined case set in a desktop test case set table according to the operation on the editing case set configuration interface, wherein each test case and corresponding execution steps are obtained from the desktop case execution record table, the desktop test case table and the desktop test case step table.
After the table is generated, all elements used for executing the test case are unified and stored in the corresponding table, so that the test case code can be automatically generated by using the table and the packaging template. Therefore, the case codes do not need to be written, the test case codes can be automatically generated only by configuring on the graphical page, and the configuration, namely the automatic test of the application is realized.
An example of automatically generating a login successful verification test case (test _000_ login successful verification. py) is as follows;
py, an example code run _ cases for the running use case set, is as follows:
the report generating unit 50 is configured to generate a test report in an HTML format from a test result obtained by running the test file. The HTML format test report adopts a uniform format, and supports a logging system to check the execution report and an enterprise wechat personalized markdown message mode, as shown in fig. 5.
In the scheme of the invention, a desktop client can be developed based on pyQT5, test files and project related information such as names and creators on an asynchronous synchronous server support local asynchronous triggering of single or multiple case sets, test results are warehoused and displayed on an interface in real time, and related logs and report formats are consistent with those of a server, as shown in FIG. 6.
The invention can be applied to desktop application, APP test and Web test, and can realize various functions by respectively carrying out the technologies of Uiautomation, win32api, unittest, facebook-wda, atxserver2, zeleunim, docker and the like.
By combining the description of the above specific embodiments, the UI automated regression testing system based on the configuration, i.e., the application mode, provided by the invention, has the following advantages compared with the prior art:
the page elements, the operation mode and the test cases are configured by adopting the graphical interface, and the unit case codes and the unified case entry files are automatically generated based on the configuration mode, namely the application mode, so that the use is convenient and quick, and the efficiency is improved.
Finally, it should also be noted that the terms "comprises," "comprising," or any other variation thereof, as used herein, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The present invention is not limited to the above-mentioned preferred embodiments, and any structural changes made under the teaching of the present invention shall fall within the scope of the present invention, which is similar or similar to the technical solutions of the present invention.
Claims (7)
1. An automated regression testing system for UI based on configuration-as-applied mode, comprising:
the page element configuration unit is used for configuring all page elements in the UI according to the identification modes of the page elements;
the operation mode configuration unit is used for selecting the page elements and configuring corresponding operation modes for the page elements, each page element and the corresponding operation mode form an operation, and a plurality of operations are assembled into a test case;
the case set assembling unit is used for selecting a plurality of corresponding test cases according to the business process, setting the execution sequence of the corresponding test cases and assembling to obtain a case set;
the test file generation unit is used for filling the page elements and the corresponding operation modes of the page elements in each test case in the case set into a preset packaging template to generate unittest case codes and generating a uniform case entry file by using discovery, wherein the unittest case codes and the case entry file form a complete test file;
and the report generating unit is used for generating a test report in an HTML format from a test result obtained by operating the test file.
2. The system according to claim 1, wherein the page element configuration unit obtains id and name of the control in the page element through microsoft control recognition tool instect in the windows page, and the web page obtains Xpath, name and class of the control in the page element by using browser self-contained F12 tool.
3. The system of claim 1, wherein the report generation unit employs an enterprise WeChat robot to notify the test results in real time within a business community.
4. The system of claim 1, wherein the report generation unit stores the execution records of the test files and the test results in a system database, and stores a test log file.
5. The system according to claim 1, wherein the page element configuration unit obtains id and name of the control in the page element through microsoft control recognition tool instect in the windows page, and the web page obtains Xpath, name and class of the control in the page element by using browser self-contained F12 tool.
6. The system according to claim 1, wherein the page element configuration unit customizes the identification manner of the configuration page element by applying a page element configuration table.
7. The system of claim 1, wherein the use cases are isolated from each other.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111544289.XA CN114218105A (en) | 2021-12-16 | 2021-12-16 | UI automatic regression testing system based on configuration application mode |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111544289.XA CN114218105A (en) | 2021-12-16 | 2021-12-16 | UI automatic regression testing system based on configuration application mode |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114218105A true CN114218105A (en) | 2022-03-22 |
Family
ID=80703046
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111544289.XA Pending CN114218105A (en) | 2021-12-16 | 2021-12-16 | UI automatic regression testing system based on configuration application mode |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114218105A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115687160A (en) * | 2022-12-30 | 2023-02-03 | 杭州兑吧网络科技有限公司 | Interface test system, method and equipment cluster |
-
2021
- 2021-12-16 CN CN202111544289.XA patent/CN114218105A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115687160A (en) * | 2022-12-30 | 2023-02-03 | 杭州兑吧网络科技有限公司 | Interface test system, method and equipment cluster |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6810494B2 (en) | Software system and methods for testing transactional servers | |
CN111930635B (en) | Swagger-based rapid automatic testing method and system | |
US6360332B1 (en) | Software system and methods for testing the functionality of a transactional server | |
US7058857B2 (en) | Method and system for testing a software product | |
US8706768B2 (en) | Managing to-do lists in task schedules in a project management system | |
US20080270841A1 (en) | Test case manager | |
US20110123973A1 (en) | Systems and methods for visual test authoring and automation | |
WO2001025909A2 (en) | Development architectures for netcentric computing systems | |
US20080162542A1 (en) | Dynamic generation of target files from template files and tracking of the processing of target files | |
CN108345532A (en) | A kind of automatic test cases generation method and device | |
JPH11296544A (en) | Structured data management system and computer-readable recording medium where structured data management program is recorded | |
US10885087B2 (en) | Cognitive automation tool | |
US20060020931A1 (en) | Method and apparatus for managing complex processes | |
CN108845940A (en) | A kind of enterprise information system automated function test method and system | |
US20120278708A1 (en) | Verifying configurations | |
CN108874680A (en) | A kind of method for testing software and system of automation | |
US20150106928A1 (en) | Screening of email templates in campaign management | |
CN108647147A (en) | It is a kind of to execute automatic test machine people and its application method using atlas analysis | |
WO2005094500A2 (en) | Document development platform | |
CN115658529A (en) | Automatic testing method for user page and related equipment | |
CN115576817A (en) | Automatic test system, method, electronic equipment and storage medium | |
CN111596899A (en) | Database migration method, system, equipment and storage medium based on Java development | |
CN114218105A (en) | UI automatic regression testing system based on configuration application mode | |
CN113836014A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN111177016B (en) | Software test defect management method |
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 |