CN110737598A - Method and device for testing page content based on page component characteristics - Google Patents
Method and device for testing page content based on page component characteristics Download PDFInfo
- Publication number
- CN110737598A CN110737598A CN201910985234.9A CN201910985234A CN110737598A CN 110737598 A CN110737598 A CN 110737598A CN 201910985234 A CN201910985234 A CN 201910985234A CN 110737598 A CN110737598 A CN 110737598A
- Authority
- CN
- China
- Prior art keywords
- test
- page
- component
- library
- test library
- 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
- 238000012360 testing method Methods 0.000 title claims abstract description 165
- 238000000034 method Methods 0.000 title claims abstract description 25
- 238000004590 computer program Methods 0.000 claims description 18
- 238000010998 test method Methods 0.000 claims description 2
- 230000005540 biological transmission Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000013515 script Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 241000208306 Apium Species 0.000 description 1
- 238000001545 Page's trend test Methods 0.000 description 1
- 238000001152 differential interference contrast microscopy Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
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/3676—Test management for coverage analysis
-
- 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/3692—Test management for test results analysis
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 provides methods and devices for testing page contents based on page component characteristics, wherein the method comprises the steps of obtaining operation of a user on a software page to be tested on equipment, judging the page component characteristics to which the operation belongs, and starting a corresponding test library to test the contents of the page according to the page component characteristics to which the operation belongs.
Description
Technical Field
The invention relates to the field of computers, in particular to methods and devices for testing page content based on page component characteristics.
Background
In the prior art, the automatic test by using the test library lacks a fixed standard and is combined with user experience to perform the test, so that the coverage of a test case is too small and the test coverage is low.
In view of the above problems in the related art, no effective solution exists at present.
Disclosure of Invention
The embodiment of the invention provides methods and devices for testing page content based on page component characteristics, which are used for at least solving the problems of small coverage of test cases and low test coverage rate caused by a test mode through a test library in the related art.
According to embodiments of the invention, test methods are provided, which comprise the steps of obtaining operation of a user on a software page to be tested on equipment, judging the page component characteristics of the operation, and starting a corresponding test library to test the content of the page according to the page component characteristics of the operation.
According to another embodiments of the present invention, types of testing apparatuses are provided, which include an obtaining module configured to obtain an operation of a user on a software page to be tested on a device, a determining module configured to determine a characteristic of a page component to which the operation belongs, and a testing module configured to start a corresponding testing library according to the characteristic of the page component to which the operation belongs to test content of the page.
According to further embodiments of the invention, there is further provided storage media having stored thereon a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when executed.
According to yet another embodiments of the present invention, there is also provided electronic device, comprising a memory having stored therein a computer program and a processor arranged to execute the computer program to perform the steps of any of the method embodiments described above.
According to the invention, the operation of the user on the software page to be tested on the equipment is obtained, the characteristic of the page component to which the operation belongs is further judged, and the corresponding test library is started to test the content of the page according to the characteristic of the page component to which the operation belongs, so that the content of the page is tested by adopting the corresponding test library according to different page component characteristics, the test of the hierarchical test library of the page component is realized, the problems of small coverage of the test case and low test coverage rate caused by the test mode of the test library in the related technology are solved, and the test coverage rate is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and constitute a part of this application , illustrate embodiments of the invention and together with the description serve to explain the invention without limiting it.
FIG. 1 is a block diagram of a hardware structure of a terminal of methods for testing page contents based on page component characteristics according to an embodiment of the present invention;
FIG. 2 is a flow diagram of a method for testing page content based on page component properties according to an embodiment of the present invention;
fig. 3 is a block diagram of an apparatus for testing page contents based on characteristics of page components according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "", "second", etc. in the description and claims of the invention and the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
For example, as shown in fig. 1, a terminal 10 may include or more (only is shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, and optionally, the terminal may further include a transmission device 106 for a communication function and an input/output device 108, and it will be understood by those skilled in the art that the structure shown in fig. 1 is merely illustrative and does not limit the structure of the terminal.
The memory 104 may be used to store computer programs, such as software programs and modules of application software, such as computer programs corresponding to the testing methods in the embodiments of the present invention, and the processor 102 may execute various functional applications and data processing by executing the computer programs stored in the memory 104, such that the methods described above are implemented.A memory 104 may include a high-speed random access memory, and may further include a non-volatile memory, such as or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.A some examples of the memory 104 may further include a memory remotely located with respect to the processor 102, which may be connected to the terminal 10 via a network.
The transmission device 106 is configured to receive or transmit data via networks, the above-mentioned specific examples of the networks may include a wireless Network provided by a communication provider of the terminal 10, in examples, the transmission device 106 includes Network adapters (Network Interface controllers, abbreviated as NICs) that may be connected to other Network devices through a base station so as to communicate with the internet, and in examples, the transmission device 106 may be a Radio Frequency (RF) module configured to communicate with the internet in a wireless manner.
In this embodiment, testing methods operating in the terminal are provided, and fig. 2 is a flowchart of a method for testing page content based on page component characteristics according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, obtaining the operation of a user on a software page to be tested on the equipment;
step S204, judging the characteristics of the page components to which the operation belongs;
and step S206, starting a corresponding test library to test the content of the page according to the characteristics of the page component to which the operation belongs.
Through the steps S202 to S206, the operation of the user on the software page to be tested on the device is obtained, the characteristic of the page component to which the operation belongs is further judged, the corresponding test library is started to test the content of the page according to the characteristic of the page component to which the operation belongs, and the test result is reported, so that the content of the page is tested by adopting the corresponding test library according to different characteristics of the page component, the test of the hierarchical test library of the page component is realized, the problems of small coverage of the test case and low test coverage rate caused by the test mode of the test library in the related art are solved, and the test coverage rate is improved.
In an optional implementation manner of this embodiment, before obtaining an operation of a user on a software page to be tested on a device, the method of this embodiment may further include: and loading the software to be tested and the test library onto the equipment.
It should be noted that, in this embodiment, in page development, a functional component part and a display component part may be divided according to page characteristics, where a display component is a component for presentation, including a static UI, and presentation and change of data; the functional components can comprise a plurality of functional components and a plurality of display components, and a UI test library, a data test library and a user operation test library can be formed according to different page components. Based on this, the corresponding test library in this embodiment includes: the system comprises a UI test library, a data test library and a user operation test library. Thus, the test libraries loaded on the device with the software to be tested include the UI test library, the data test library, and the user-operated test library.
The UI test library, the data test library and the operation test library are written into three scripts for automatic testing respectively and loaded on the testing device together with the tested software , wherein the language used by the automatic testing scripts can be determined according to a test developer, for example, a python development language, a frame used for the APP automatic testing scripts is python2.7 node and Apium, and a frame used for the web automatic testing scripts is python2.7 combined with Selenium2 and the like.
Based on the above description, in an alternative implementation manner of this embodiment, the manner of determining the page component characteristics to which the operation belongs in step S204 of this application is as follows: and judging the characteristic of the page component to which the operation belongs to be a display component or a functional component. That is, the page component properties in this application include a display component and a function component.
In another optional embodiments of this embodiment, the manner for starting the corresponding test library to test the content of the page according to the page component characteristic to which the operation belongs in step S206 includes:
and S206-11, testing the content of the page according to an th test library under the condition that the characteristic of the page component to which the operation belongs is a display component, wherein the th test library comprises a UI test library and a data test library.
Step S206-12, under the condition that the characteristic of the page component to which the operation belongs is a functional component, testing the content of the page according to a second test library; wherein the second test library comprises: UI test library, data test library and operation test library.
As can be seen from the above steps S206-11 and S206-12, different test libraries are used for different page component characteristics, that is, the page test contents are divided into the UI test library, the data test library and the operation test library, so that the manner of automatically testing the page contents by the hierarchical test library is realized, and the test coverage is improved.
In addition, in an optional implementation manner of this embodiment, after the test is completed, the method of this embodiment may further include reporting the test result, and the reporting of the test result may be, in a specific application scenario, sending the test report to a tester in various forms (e.g., mail, etc.), or directly displaying a fault occurring in the test on a test screen dedicated for the test, so that the fault is conveniently analyzed, and further improvement of software by a developer is facilitated .
Based on the understanding that the technical solution of the present invention per se or parts contributing to the prior art can be embodied in the form of software products stored in storage media (such as ROM/RAM, magnetic disk, optical disk) and including instructions for causing terminal devices (which may be mobile phones, computers, servers, or network devices) to execute the methods according to the embodiments of the present invention.
Example 2
In the present embodiment, apparatus for testing page content based on page component characteristics is provided, and is used to implement the above-mentioned embodiments and preferred embodiments, which have been described and will not be described in detail.
Fig. 3 is a block diagram of an apparatus for testing page contents based on page component characteristics according to an embodiment of the present invention, as shown in fig. 3, the apparatus includes: the obtaining module 32 is configured to obtain an operation of a user on a software page to be tested on a device; the judging module 34 is coupled and linked with the obtaining module 32 and is used for judging the characteristics of the page components to which the operation belongs; and the test module 36 is coupled and linked with the judgment module 34 and is used for starting a corresponding test library to test the content of the page according to the characteristic of the page component to which the operation belongs.
Optionally, the determining module 34 in this embodiment is further configured to determine that the characteristic of the page component to which the operation belongs is a display component or a functional component.
Optionally, the test module 36 in this embodiment may further include a test unit configured to test the content of the page according to a test library when the characteristic of the page component to which the operation belongs is the display component, where the test library includes a UI test library and a data test library, and the second test unit is configured to test the content of the page according to a second test library when the characteristic of the page component to which the operation belongs is the functional component, where the second test library includes a UI test library, a data test library and an operation test library.
Optionally, the apparatus in this embodiment may further include: and the loading module is used for loading the software to be tested and the test library onto the equipment before the operation of the user on the software page to be tested on the equipment is acquired.
Optionally, the apparatus in this embodiment may further include: and the reporting module is used for reporting the test result.
It should be noted that the above modules may be implemented by software or hardware, and for the latter, the modules may be implemented by, but are not limited to, being located in the same processor, or being located in different processors in any combination.
Example 3
An embodiment of the present invention further provides storage media having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring the operation of the user on the software page to be tested on the equipment;
s2, judging the characteristic of the page component to which the operation belongs;
and S3, starting a corresponding test library to test the content of the page according to the characteristics of the page component to which the operation belongs.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention further provide electronic devices, comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring the operation of the user on the software page to be tested on the equipment;
s2, judging the characteristic of the page component to which the operation belongs;
and S3, starting a corresponding test library to test the content of the page according to the characteristics of the page component to which the operation belongs.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.
Claims (15)
1, A test method, comprising:
acquiring the operation of a user on a software page to be tested on equipment;
judging the characteristic of the page component to which the operation belongs;
and starting a corresponding test library to test the content of the page according to the page component characteristic to which the operation belongs.
2. The method of claim 1, wherein determining the page component characteristics to which the operation belongs comprises:
and judging the characteristic of the page component to which the operation belongs to be a display component or a functional component.
3. The method of claim 2, wherein starting a corresponding test library to test the content of the page according to the page component characteristic to which the operation belongs comprises:
and testing the content of the page according to an th test library under the condition that the characteristic of the page component to which the operation belongs is a display component, wherein the th test library comprises a UI test library and a data test library.
4. The method of claim 2, wherein starting a corresponding test library to test the content of the page according to the page component characteristic to which the operation belongs comprises:
under the condition that the characteristic of the page component to which the operation belongs is a functional component, testing the content of the page according to a second test library; wherein the second test library comprises: UI test library, data test library and operation test library.
5. The method of any of claims 1-4, wherein prior to obtaining user operations on a software page to be tested on a device, the method further comprises:
and loading the software to be tested and the test library onto the equipment.
6. The method of any of claims 1-4, further comprising reporting the test result.
A test device of type, comprising:
the acquisition module is used for acquiring the operation of a user on a software page to be tested on the equipment;
the judging module is used for judging the characteristics of the page components to which the operation belongs;
and the test module is used for starting a corresponding test library to test the content of the page according to the characteristic of the page component to which the operation belongs and reporting a test result.
8. The apparatus of claim 7,
the judging module is further configured to judge that the characteristic of the page component to which the operation belongs is a display component or a functional component.
9. The apparatus of claim 8, wherein the test module comprises:
and the test unit is used for testing the content of the page according to the test library under the condition that the characteristic of the page component to which the operation belongs is a display component, wherein the test library comprises a UI test library and a data test library.
10. The apparatus of claim 8, wherein the test module comprises:
the second testing unit is used for testing the content of the page according to a second testing library under the condition that the characteristic of the page component to which the operation belongs is a functional component; wherein the second test library comprises: UI test library, data test library and operation test library.
11. The apparatus of any one of claims 7 to 10, , further comprising:
and the loading module is used for loading the software to be tested and the test library onto the equipment before the operation of the user on the software page to be tested on the equipment is obtained.
12. The apparatus according to of any of claims 7-10, further comprising a reporting module configured to report the test result.
An apparatus of , comprising the device of any of claims 7-12, .
14, computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to, when run, perform the method of any of claims 1 to 6 to .
15, electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the computer program to perform the method of any of claims 1 to 6 to .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910985234.9A CN110737598A (en) | 2019-10-16 | 2019-10-16 | Method and device for testing page content based on page component characteristics |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910985234.9A CN110737598A (en) | 2019-10-16 | 2019-10-16 | Method and device for testing page content based on page component characteristics |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110737598A true CN110737598A (en) | 2020-01-31 |
Family
ID=69269191
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910985234.9A Pending CN110737598A (en) | 2019-10-16 | 2019-10-16 | Method and device for testing page content based on page component characteristics |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110737598A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115827499A (en) * | 2023-02-22 | 2023-03-21 | 江苏北弓智能科技有限公司 | UI automation test method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130042222A1 (en) * | 2011-08-08 | 2013-02-14 | Computer Associates Think, Inc. | Automating functionality test cases |
CN104679658A (en) * | 2015-03-17 | 2015-06-03 | 百度在线网络技术(北京)有限公司 | Test method and test system for WEB pages |
CN106528416A (en) * | 2016-11-03 | 2017-03-22 | 上海斐讯数据通信技术有限公司 | android platform-based automation testing method and system |
CN106991048A (en) * | 2017-03-31 | 2017-07-28 | 杭州迪普科技股份有限公司 | Webpage method of testing and device |
CN110046101A (en) * | 2019-04-15 | 2019-07-23 | 腾讯音乐娱乐科技(深圳)有限公司 | Page automated testing method, device and computer storage medium |
-
2019
- 2019-10-16 CN CN201910985234.9A patent/CN110737598A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130042222A1 (en) * | 2011-08-08 | 2013-02-14 | Computer Associates Think, Inc. | Automating functionality test cases |
CN104679658A (en) * | 2015-03-17 | 2015-06-03 | 百度在线网络技术(北京)有限公司 | Test method and test system for WEB pages |
CN106528416A (en) * | 2016-11-03 | 2017-03-22 | 上海斐讯数据通信技术有限公司 | android platform-based automation testing method and system |
CN106991048A (en) * | 2017-03-31 | 2017-07-28 | 杭州迪普科技股份有限公司 | Webpage method of testing and device |
CN110046101A (en) * | 2019-04-15 | 2019-07-23 | 腾讯音乐娱乐科技(深圳)有限公司 | Page automated testing method, device and computer storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115827499A (en) * | 2023-02-22 | 2023-03-21 | 江苏北弓智能科技有限公司 | UI automation test method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109302522B (en) | Test method, test device, computer system, and computer medium | |
US20180253373A1 (en) | Systems and methods for automated web performance testing for cloud apps in use-case scenarios | |
CN105787364B (en) | Automatic testing method, device and system for tasks | |
CN109656806A (en) | A kind of the playback test method and device of interface data | |
CN109344066B (en) | Method, system and terminal for testing browser page | |
CN109684188B (en) | Test method and device | |
US20120185624A1 (en) | Automated Cabling Process for a Complex Environment | |
CN105302722A (en) | CTS automatic test method and apparatus | |
CN109041267B (en) | Network connection fault processing method and device and electronic equipment | |
CN109828920A (en) | A kind of log analysis method, device and computer readable storage medium | |
CN107992386A (en) | A kind of router memory method for testing pressure and system | |
CN108023905B (en) | Internet of things application system and method | |
US20160105810A1 (en) | Technique for testing wireless network load produced by mobile app-carrying devices | |
CN111061448A (en) | Log information display method and device, electronic equipment and storage medium | |
CN110737598A (en) | Method and device for testing page content based on page component characteristics | |
CN111176985B (en) | Software interface performance testing method and device, computer equipment and storage medium | |
US9774408B2 (en) | Mobile communication terminal test device and a test analysis unit therefor | |
CN112416734A (en) | Test method, device and storage medium | |
CN111008143A (en) | Coverage rate scheduling test method, terminal device and computer readable storage medium | |
CN107193728A (en) | Mobile terminal automation testing method and device | |
CN109144841B (en) | Method and device for identifying advertisement application, computer equipment and storage medium | |
CN113535580B (en) | CTS test method, CTS test device and test equipment | |
CN113934552A (en) | Method and device for determining function code, storage medium and electronic device | |
CN114466395A (en) | Method and device for testing performance of base station, storage medium and electronic device | |
CN113392010A (en) | Common component testing method and device, electronic equipment and storage medium |
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: 20200131 |