CN111209183A - UI function traversal test method and device - Google Patents

UI function traversal test method and device Download PDF

Info

Publication number
CN111209183A
CN111209183A CN201811397606.8A CN201811397606A CN111209183A CN 111209183 A CN111209183 A CN 111209183A CN 201811397606 A CN201811397606 A CN 201811397606A CN 111209183 A CN111209183 A CN 111209183A
Authority
CN
China
Prior art keywords
test
function
attribute information
report
file
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
CN201811397606.8A
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.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp 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 China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN201811397606.8A priority Critical patent/CN111209183A/en
Publication of CN111209183A publication Critical patent/CN111209183A/en
Pending legal-status Critical Current

Links

Images

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)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a UI function traversal testing method and device, and relates to the technical field of IT. The method comprises the following steps: traversing elements in the software to acquire element attribute information; establishing a functional element rule based on the element attribute information; generating a test file based on the functional element rule and the test logic; and running the test file to generate a test report so as to determine problems in the test process according to the test report. According to the invention, the association between the elements and the functions is established through the attribute information in the elements, and the UI test and the function test are combined, so that the test flow can be simplified, and the test workload can be further reduced.

Description

UI function traversal test method and device
Technical Field
The invention relates to the technical field of IT (information technology), in particular to a method and a device for traversing and testing functions of a User Interface (UI).
Background
After software development is completed, UI and functionality tests are required to be carried out for ensuring the online quality of software. But the test workload is increased along with the increase of software functions, the increase of the number of pages and the increase of the depth of the pages.
Disclosure of Invention
The invention aims to provide a method and a device for traversing and testing UI functions, which can simplify the testing process and further reduce the testing workload.
According to an aspect of the present invention, a method for traversing and testing UI functions of a user interface is provided, including: traversing elements in the software to acquire element attribute information; establishing a functional element rule based on the element attribute information; generating a test file based on the functional element rule and the test logic; and running the test file to generate a test report so as to determine problems in the test process according to the test report.
In one embodiment, establishing the functional element rule based on the element attribute information comprises: identifying a function point corresponding to each element attribute information based on the element attribute information; and making different testing flows for different functional points according to the service requirements.
In one embodiment, running the test file to generate the test report includes: and operating the test file in the test system in a parameter form to generate a test report.
In one embodiment, the element attribute information includes content description information, package name information, and class name information in the element.
In one embodiment, the test reports include UI test reports and functional test reports.
In another embodiment of the present invention, a user interface UI function traversal testing apparatus is further provided, including: the attribute acquisition unit is used for traversing elements in the software and acquiring element attribute information; a rule establishing unit for establishing a functional element rule based on the element attribute information; the test file generating unit is used for generating a test file based on the functional element rule and the test logic; and the test result determining unit is used for operating the test file to generate a test report so as to determine the problems in the test process according to the test report.
In one embodiment, the rule establishing unit is configured to identify a function point corresponding to each element attribute information based on the element attribute information, and formulate different test flows for different function points according to service requirements.
In one embodiment, the test result determining unit is configured to run the test file in the test system in the form of parameters to generate the test report.
In one embodiment, the element attribute information includes content description information, package name information, and class name information in the element.
In one embodiment, the test reports include UI test reports and functional test reports.
In another embodiment of the present invention, a user interface UI function traversal testing apparatus is further provided, including: a memory; and a processor coupled to the memory, the processor configured to perform the UI function traversal test method as described above based on the instructions stored in the memory.
In another embodiment of the present invention, a computer-readable storage medium is further proposed, on which computer program instructions are stored, which when executed by a processor implement the steps of the UI function traversal test method described above.
Compared with the prior art, the method and the device have the advantages that the association between the elements and the functions is established through the attribute information in the elements, the UI test and the function test are combined, the test flow can be simplified, and the test workload can be further reduced.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
The invention will be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
fig. 1 is a flowchart illustrating a UI function traversal testing method according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a UI function traversal testing method according to another embodiment of the present invention.
Fig. 3 is a schematic structural diagram of an embodiment of the UI function traversal testing apparatus of the present invention.
Fig. 4 is a schematic structural diagram of another embodiment of the UI function traversal testing device of the present invention.
Fig. 5 is a schematic structural diagram of a UI function traversal testing apparatus according to another embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to specific embodiments and the accompanying drawings.
Fig. 1 is a flowchart illustrating a UI function traversal testing method according to an embodiment of the present invention.
In step 110, elements in the software are traversed to obtain element attribute information. The element attribute information includes content-desc (content description information), package (package name information), class (class name), and other information in the element.
At step 120, functional element rules are established based on the element attribute information. For example, identifying a function point corresponding to each element attribute information based on the element attribute information; and making different testing flows for different functional points according to the service requirements.
At step 130, a test file is generated based on the functional element rules and the test logic.
At step 140, the test file is run to generate a test report to determine problems during the test based on the test report. And running the test file in the test system in a parameter form to generate a UI test report and a functional test report.
In the embodiment, the association between the elements and the functions is established through the attribute information in the elements, and the UI test and the function test are combined, so that the test flow can be simplified, and the test workload can be further reduced.
Fig. 2 is a flowchart illustrating a UI function traversal testing method according to another embodiment of the present invention.
In step 210, traversing the elements in the software, and acquiring content-desc, package, class and other information in the elements.
In step 220, the function point corresponding to the element is identified by the content-desc, package, class, etc. information in the element.
In step 230, different functional points are made into different test flows according to actual business needs.
At step 240, a test file is generated based on the test flow and the test logic, the test file being an external file. For example, after issuing a test task, the automated test system generates an external file for the test logic and the test flow related to the functional element. The test logic can be formulated according to the test case.
In step 250, the generated test file is imported into the automatic test system to run in the UI function automatic test in the form of parameters.
At step 260, the problems discovered during the automated testing process are analyzed based on the test reports generated during the automated testing. For example, the UI test report mainly indicates abnormalities such as display position shift, interface element missing and the like in the UI aspect; the functional test report mainly indicates the problems of logic aspects in the test process, such as incorrect page jump, incorrect corresponding relation between input values and return values, and the like.
In the embodiment, the UI test and the function test are combined, so that the test flow can be simplified, and the test workload can be reduced.
Fig. 3 is a schematic structural diagram of an embodiment of the UI function traversal testing apparatus of the present invention. The apparatus includes an attribute obtaining unit 310, a rule establishing unit 320, a test file generating unit 330, and a test result determining unit 340.
The attribute obtaining unit 310 is configured to traverse the elements in the software to obtain attribute information of the elements. The element attribute information includes content-desc, package, class, and other information in the element.
The rule establishing unit 320 is used for establishing the function element rule based on the element attribute information. For example, identifying a function point corresponding to each element attribute information based on the element attribute information; and making different testing flows for different functional points according to the service requirements.
The test file generating unit 330 is configured to generate a test file based on the functional element rule and the test logic. For example, after issuing a test task, the automated test system generates a test file according to the relevant test flow and test logic of the functional element. The test logic can be formulated according to the test case.
The test result determining unit 340 is configured to run the test file to generate a test report, so as to determine a problem in the test process according to the test report. For example, the generated test file is imported into an automatic test system to run in the form of parameters in the UI function automatic test, and the problems found in the automatic test process are analyzed according to the test report generated in the automatic test.
The test report comprises a UI test report and a function test report, wherein the UI test report mainly indicates the display position offset, interface element loss and other abnormalities in the aspect of UI; the functional test report mainly indicates the problems of logic aspects in the test process, such as incorrect page jump, incorrect corresponding relation between input values and return values, and the like.
In the embodiment, the association between the elements and the functions is established through the attribute information in the elements, and the UI test and the function test are combined, so that the test flow can be simplified, and the test workload can be further reduced.
Fig. 4 is a schematic structural diagram of another embodiment of the UI function traversal testing device of the present invention. The apparatus includes a memory 410 and a processor 420, wherein:
the memory 410 may be a magnetic disk, flash memory, or any other non-volatile storage medium. The memory is used for storing instructions in the embodiments corresponding to fig. 1 and 2. Processor 420 is coupled to memory 410 and may be implemented as one or more integrated circuits, such as a microprocessor or microcontroller. The processor 420 is configured to execute instructions stored in memory.
In one embodiment, the apparatus 500 may also include a memory 510 and a processor 520, as shown in FIG. 5. Processor 520 is coupled to memory 510 by a BUS 530. The apparatus 500 may be further connected to an external storage device 550 through a storage interface 540 for accessing external data, and may be further connected to a network or another computer system (not shown) through a network interface 560, which will not be described in detail herein.
In the embodiment, the data instruction is stored in the memory, the instruction is processed by the processor, the association between the element and the function is established through the attribute information in the element, the UI test and the function test are combined, the test flow can be simplified, and the test workload can be reduced.
In another embodiment, a computer-readable storage medium has stored thereon computer program instructions which, when executed by a processor, implement the steps of the method in the corresponding embodiments of fig. 1, 2. As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, apparatus, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Thus far, the present disclosure has been described in detail. Some details that are well known in the art have not been described in order to avoid obscuring the concepts of the present disclosure. It will be fully apparent to those skilled in the art from the foregoing description how to practice the presently disclosed embodiments.
Although some specific embodiments of the present invention have been described in detail by way of illustration, it should be understood by those skilled in the art that the above illustration is only for the purpose of illustration and is not intended to limit the scope of the invention. It will be appreciated by those skilled in the art that modifications may be made to the above embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.

Claims (12)

1. A User Interface (UI) function traversal testing method comprises the following steps:
traversing elements in the software to acquire element attribute information;
establishing a functional element rule based on the element attribute information;
generating a test file based on the functional element rule and the test logic;
and operating the test file to generate a test report so as to determine problems in the test process according to the test report.
2. The UI function traversal testing method of claim 1, wherein establishing a function element rule based on the element attribute information comprises:
identifying a function point corresponding to each element attribute information based on the element attribute information;
and making different testing flows for different functional points according to the service requirements.
3. The UI function traversal testing method of claim 1, wherein running the test file to generate a test report comprises:
and operating the test file in a test system in a parameter form to generate the test report.
4. The UI function traversal test method of claim 1, wherein,
the element attribute information includes content description information, package name information, and class name information in the element.
5. The UI function traversal test method of any of claims 1-4, wherein,
the test report comprises a UI test report and a functional test report.
6. A user interface, UI, functionality traversal test apparatus, comprising:
the attribute acquisition unit is used for traversing elements in the software and acquiring element attribute information;
a rule establishing unit for establishing a functional element rule based on the element attribute information;
the test file generating unit is used for generating a test file based on the functional element rule and the test logic;
and the test result determining unit is used for operating the test file to generate a test report so as to determine problems in the test process according to the test report.
7. The UI function traversal testing device of claim 6, wherein,
the rule establishing unit is used for identifying the function points corresponding to the element attribute information based on the element attribute information and formulating different test flows for different function points according to business requirements.
8. The UI function traversal testing device of claim 6, wherein,
the test result determining unit is used for operating the test file in a test system in a parameter form to generate the test report.
9. The UI function traversal testing device of claim 6, wherein,
the element attribute information includes content description information, package name information, and class name information in the element.
10. The UI function traversal testing device of any of claims 6-9, wherein,
the test report comprises a UI test report and a functional test report.
11. A user interface, UI, functionality traversal test apparatus, comprising:
a memory; and
a processor coupled to the memory, the processor configured to execute the UI function traversal test method of any of claims 1-5 based on instructions stored in the memory.
12. A computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the UI function traversal testing method of any of claims 1 to 5.
CN201811397606.8A 2018-11-22 2018-11-22 UI function traversal test method and device Pending CN111209183A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811397606.8A CN111209183A (en) 2018-11-22 2018-11-22 UI function traversal test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811397606.8A CN111209183A (en) 2018-11-22 2018-11-22 UI function traversal test method and device

Publications (1)

Publication Number Publication Date
CN111209183A true CN111209183A (en) 2020-05-29

Family

ID=70788009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811397606.8A Pending CN111209183A (en) 2018-11-22 2018-11-22 UI function traversal test method and device

Country Status (1)

Country Link
CN (1) CN111209183A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112036843A (en) * 2020-06-30 2020-12-04 北京来也网络科技有限公司 Flow element positioning method, device, equipment and medium based on RPA and AI

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140229920A1 (en) * 2013-02-13 2014-08-14 Sap Ag Dynamic scenario testing of web application
CN104679658A (en) * 2015-03-17 2015-06-03 百度在线网络技术(北京)有限公司 Test method and test system for WEB pages
CN106959921A (en) * 2017-02-20 2017-07-18 百度在线网络技术(北京)有限公司 Automatic test approach, terminal, platform and system
CN107122301A (en) * 2017-04-27 2017-09-01 武汉斗鱼网络科技有限公司 Interface detection method and device
CN107506300A (en) * 2017-08-09 2017-12-22 百度在线网络技术(北京)有限公司 A kind of ui testing method, apparatus, server and storage medium
CN107577607A (en) * 2017-09-07 2018-01-12 携程旅游信息技术(上海)有限公司 User interface automated testing method, device, electronic equipment, storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140229920A1 (en) * 2013-02-13 2014-08-14 Sap Ag Dynamic scenario testing of web application
CN104679658A (en) * 2015-03-17 2015-06-03 百度在线网络技术(北京)有限公司 Test method and test system for WEB pages
CN106959921A (en) * 2017-02-20 2017-07-18 百度在线网络技术(北京)有限公司 Automatic test approach, terminal, platform and system
CN107122301A (en) * 2017-04-27 2017-09-01 武汉斗鱼网络科技有限公司 Interface detection method and device
CN107506300A (en) * 2017-08-09 2017-12-22 百度在线网络技术(北京)有限公司 A kind of ui testing method, apparatus, server and storage medium
CN107577607A (en) * 2017-09-07 2018-01-12 携程旅游信息技术(上海)有限公司 User interface automated testing method, device, electronic equipment, storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112036843A (en) * 2020-06-30 2020-12-04 北京来也网络科技有限公司 Flow element positioning method, device, equipment and medium based on RPA and AI

Similar Documents

Publication Publication Date Title
CN108614770B (en) Automatic test assertion method, device, storage medium and equipment
CN109960653A (en) Regression testing method, device, equipment and storage medium
CN109583746B (en) Method and device for setting routing rule of flow and readable storage medium
CN107145437B (en) Java annotation test method and device
CN106909454B (en) Rule processing method and equipment
CN111078677B (en) Data entry method and device
CN111125067B (en) Data maintenance method and device
CN107818051B (en) Test case jump analysis method and device and server
CN110737573B (en) Method and device for automatically testing user interface UI
JP5605397B2 (en) Method and apparatus for determining necessity of joint inspection
CN111209183A (en) UI function traversal test method and device
US9436587B2 (en) Test context generation
EP2990983A1 (en) Method and apparatus for scanning files
CN105574816A (en) Method and device for eliminating grid shadows of X-ray images as well as X-ray machine updating package
CN113688403A (en) Intelligent contract vulnerability detection method and device based on symbolic execution verification
CN113001538B (en) Command analysis method and system
CN110515653B (en) Document generation method and device, electronic equipment and computer readable storage medium
CN112463202B (en) Configuration method and device of operating system functional components
CN113672509A (en) Automatic testing method, device, testing platform and storage medium
CN106055625B (en) Method and device for executing service
CN113792247B (en) Method, apparatus, device and medium for generating functional flow chart based on code characteristics
CN111125165A (en) Set merging method, device, processor and machine-readable storage medium
US10157056B2 (en) Device, method, and program for visualizing dependent portions of program
CN112988768B (en) Method and device for realizing data tracing
CN109117359A (en) Serialize test method and device

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: 20200529