CN112905483A - Automatic testing method and device based on webpage - Google Patents

Automatic testing method and device based on webpage Download PDF

Info

Publication number
CN112905483A
CN112905483A CN202110320530.4A CN202110320530A CN112905483A CN 112905483 A CN112905483 A CN 112905483A CN 202110320530 A CN202110320530 A CN 202110320530A CN 112905483 A CN112905483 A CN 112905483A
Authority
CN
China
Prior art keywords
equipment
test
basic information
script
test script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110320530.4A
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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies 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 Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN202110320530.4A priority Critical patent/CN112905483A/en
Publication of CN112905483A publication Critical patent/CN112905483A/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

Abstract

The disclosure relates to a webpage-based automated testing method, a webpage-based automated testing device, electronic equipment and a computer-readable medium. The method comprises the following steps: acquiring basic information of equipment to be tested, wherein the basic information comprises an equipment name and an equipment model; acquiring a webpage function menu of the equipment based on the basic information; generating the test script set based on the webpage function menu; and automatically testing the equipment based on the test script set. The automatic testing method and device based on the webpage, the electronic equipment and the computer readable medium can optimize the automatic testing system based on the webpage, reduce the time for compiling the test script set and improve the automatic testing efficiency of new products and new models of equipment.

Description

Automatic testing method and device based on webpage
Technical Field
The present disclosure relates to the field of computer information processing, and in particular, to a method and an apparatus for automated testing based on a web page, an electronic device, and a computer-readable medium.
Background
In the process of software testing, a tester usually designs a test case, tests are performed step by step according to steps in the test case after the test case passes review, and an actual test result is compared with an expected test result. In companies producing many products, each product is developed based on a unified development platform, but because of a lot of products, each product has multiple models at the same time, and functions are different. In the automatic test of a new device model of a certain product, a function test script corresponding to the device of the model is manually selected from an automatic test script library each time and is organized into a test script set aiming at the model, and the test script set can be used as the input of an automatic control module to carry out the automatic test after being sorted.
Because the development is carried out based on a unified development platform, different products or different models of the same product have a plurality of same functions, and because the test script set of each model is independently compiled, the test script set script needs to be rearranged once again when the same function is met each time, and the repeated workload is large; the arrangement time of the test script set of each model is long, and the test progress is influenced; therefore, a new web-based automated testing method, apparatus, electronic device and computer readable medium are needed.
The above information disclosed in this background section is only for enhancement of understanding of the background of the disclosure and therefore it may contain information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
In view of this, the present disclosure provides a web-based automated testing method, apparatus, electronic device and computer readable medium, which can optimize a web-based automated testing system, reduce the time for compiling a test script set, and improve the automated testing efficiency of new products and new models of devices.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to one aspect of the disclosure, an automated testing method based on a webpage is provided, the method comprising: acquiring basic information of equipment to be tested, wherein the basic information comprises an equipment name and an equipment model; acquiring a webpage function menu of the equipment based on the basic information; generating the test script set based on the webpage function menu; and automatically testing the equipment based on the test script set.
In an exemplary embodiment of the present disclosure, acquiring basic information of a device to be tested includes: and automatically identifying basic information of the equipment according to a preset program.
In an exemplary embodiment of the present disclosure, before acquiring the web page function menu of the device based on the basic information, the method further includes: comparing the basic information with the basic information of a plurality of devices in a test script set library; when the comparison is inconsistent, acquiring a webpage function menu of the equipment based on the basic information; and when the comparison is consistent, extracting a corresponding test script set from the test script set library.
In an exemplary embodiment of the present disclosure, acquiring a web function menu of the device based on the basic information includes: logging in an equipment page of the equipment based on the basic information; and reading the webpage function menu from the equipment page.
In an exemplary embodiment of the present disclosure, generating the test script set based on the web page function menu includes: generating a function directory according to the display hierarchy in the webpage function menu; and extracting scripts in a script library based on the function catalog to generate the test script set.
In an exemplary embodiment of the present disclosure, extracting a script in a script library based on the functional directory to generate the test script set includes: traversing the device functions in the function directory; extracting scripts in the script library based on the basic information and the device functions to generate the test script set.
In an exemplary embodiment of the present disclosure, automatically testing the device based on the set of test scripts includes: and carrying out automatic testing one by one from top to bottom based on the levels corresponding to the equipment functions in the function directory.
In an exemplary embodiment of the present disclosure, further comprising: and storing the basic information and the corresponding test script set in the test script set library.
In an exemplary embodiment of the present disclosure, further comprising: obtaining test scripts corresponding to the multiple devices; and storing the test scripts in different script catalogues according to the types and protocols of the equipment to generate a script library.
In an exemplary embodiment of the present disclosure, further comprising: and regularly maintaining the script library.
According to an aspect of the present disclosure, an automated testing apparatus based on a web page is provided, the apparatus including: the device comprises an information module, a test module and a test module, wherein the information module is used for acquiring basic information of equipment to be tested, and the basic information comprises an equipment name and an equipment model; the function module is used for acquiring a webpage function menu of the equipment based on the basic information; the collection module is used for generating the test script collection based on the webpage function menu; and the testing module is used for carrying out automatic testing on the equipment based on the testing script set.
According to an aspect of the present disclosure, an electronic device is provided, the electronic device including: one or more processors; storage means for storing one or more programs; when executed by one or more processors, cause the one or more processors to implement a method as above.
According to an aspect of the disclosure, a computer-readable medium is proposed, on which a computer program is stored, which program, when being executed by a processor, carries out the method as above.
According to the automatic testing method and device based on the webpage, the electronic equipment and the computer readable medium, basic information of equipment to be tested is obtained, wherein the basic information comprises an equipment name and an equipment model; acquiring a webpage function menu of the equipment based on the basic information; generating the test script set based on the webpage function menu; the automatic testing mode of the equipment based on the test script set can optimize an automatic testing system based on a webpage, reduce the compiling time of the test script set and improve the automatic testing efficiency of new products and new models of equipment.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. The drawings described below are merely some embodiments of the present disclosure, and other drawings may be derived from those drawings by those of ordinary skill in the art without inventive effort.
Fig. 1 is a system block diagram illustrating a method and apparatus for web-based automated testing according to an exemplary embodiment.
FIG. 2 is a flow diagram illustrating a method for web-based automated testing, according to an exemplary embodiment.
FIG. 3 is a schematic diagram illustrating a web-based automated testing method according to another exemplary embodiment.
FIG. 4 is a flowchart illustrating a method for web-based automated testing, according to another exemplary embodiment.
FIG. 5 is a schematic diagram illustrating a web-based automated testing method according to another exemplary embodiment.
FIG. 6 is a block diagram illustrating a web-based automated testing apparatus in accordance with an exemplary embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
FIG. 8 is a block diagram illustrating a computer-readable medium in accordance with an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It will be understood that, although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one element from another. Thus, a first component discussed below may be termed a second component without departing from the teachings of the disclosed concept. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
It is to be understood by those skilled in the art that the drawings are merely schematic representations of exemplary embodiments, and that the blocks or processes shown in the drawings are not necessarily required to practice the present disclosure and are, therefore, not intended to limit the scope of the present disclosure.
FIG. 1 is a system block diagram illustrating a method, apparatus, electronic device, and computer-readable medium for web-based automated testing according to an example embodiment.
As shown in fig. 1, the system architecture 10 may include devices under test 101, 102, 103, a network 104 and a test server 105. The network 104 is used to provide a medium of communication links between the devices under test 101, 102, 103 and the test server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the devices under test 101, 102, 103 to interact with the test server 105 over the network 104 to receive test cases or to send test results, etc. Various communication client applications, such as a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like, may be installed on the devices to be tested 101, 102, and 103.
The devices to be tested 101, 102, 103 may be any electronic device including, but not limited to, switches, smart phones, tablets, laptop and desktop computers, and the like.
The test server 105 may be a server providing various services, such as a background management server for automated testing of the devices under test 101, 102, 103. The background management server may test the devices to be tested 101, 102, 103 according to the content in the test script set, receive the test result, and generate a test report.
The test server 105 may, for example, obtain basic information of the device to be tested, the basic information including a device name and a device model; the test server 105 may, for example, obtain a web function menu for the device based on the base information; the test server 105 may generate the set of test scripts, for example, based on the web page functionality menu; the test server 105 may, for example, perform automated testing of the device based on the set of test scripts.
The test server 105 may also, for example, store the base information and its corresponding test script set in the test script set library.
The test server 105 may also, for example, obtain test scripts corresponding to the plurality of devices; and storing the test scripts in different script catalogues according to the types and protocols of the equipment to generate a script library.
The test server 105 may be a physical server, or may be composed of a plurality of servers, for example, it should be noted that the web-based automated test method provided by the embodiment of the present disclosure may be executed by the test server 105, and accordingly, the web-based automated test apparatus may be disposed in the test server 105.
FIG. 2 is a flow diagram illustrating a method for web-based automated testing, according to an exemplary embodiment. The web-based automated testing method 20 includes at least steps S202 to S208.
As shown in fig. 2, in S202, basic information of a device to be tested is acquired, where the basic information includes a device name and a device model. The basic information of the device can be automatically identified, for example, according to a preset program.
In S204, a web function menu of the device is acquired based on the basic information. A device page of the device may be logged in, for example, based on the base information; and reading the webpage function menu from the equipment page.
Before acquiring the web function menu of the device based on the basic information, the method further includes: comparing the basic information with the basic information of a plurality of devices in a test script set library; when the comparison is inconsistent, acquiring a webpage function menu of the equipment based on the basic information; and when the comparison is consistent, extracting a corresponding test script set from the test script set library.
In S206, the test script set is generated based on the web page function menu. Generating a function directory according to a display hierarchy in the web function menu; and extracting scripts in a script library based on the function catalog to generate the test script set. And automatically reading a function list in the equipment menu bar, generating a test script set main directory corresponding to the equipment style according to the function list of the equipment menu bar, and generating different test script sets aiming at different equipment information.
In one embodiment, further comprising: obtaining test scripts corresponding to the multiple devices; and storing the test scripts in different script catalogues according to the types and protocols of the equipment to generate a script library, and regularly maintaining the script library.
More specifically, the scripts can be managed according to categories, such as the routing management module is a routing table, a static route, a policy route, a unicast route, a multicast route, etc., wherein the unicast route is further divided into tiny modules according to various protocols (isis, rip, bgp, etc.). Generally, when a script is stored in a script library, the script is stored in different script directories according to different functions of the script. The script library management module is mainly used for newly adding, modifying and deleting scripts, and the work of testers is converted into a rich script library instead of compiling a test script set for each type of equipment.
In S208, the device is automatically tested based on the set of test scripts. After the automatic control module executes the complete test script set script each time, a report in the html format is automatically generated, and the execution result of the test script set can be visually displayed. The test case execution condition can be recorded, and the failure log can timely find errors existing in equipment and is beneficial to optimization and adjustment of an automation process.
In one embodiment, further comprising: and storing the basic information and the corresponding test script set in the test script set library.
According to the automatic testing method based on the webpage, basic information of equipment to be tested is obtained, wherein the basic information comprises an equipment name and an equipment model; acquiring a webpage function menu of the equipment based on the basic information; generating the test script set based on the webpage function menu; the automatic testing mode of the equipment based on the test script set can optimize an automatic testing system based on a webpage, reduce the compiling time of the test script set and improve the automatic testing efficiency of new products and new models of equipment.
Because the development is carried out based on a unified development platform, different products or different models of the same product have a plurality of same functions, and because the test script set of each model is independently compiled, the same functions need to be re-planned and collated when the scripts of different test script sets are collated, and the repeated workload is more; according to the automatic testing method based on the webpage, repeated workload can be reduced by perfecting a testing script set script library.
Aiming at the problems that each model device is long in test script set compiling time, manual maintenance is complex, and test progress is influenced, the automatic test method based on the webpage provides a method for automatically generating the test script set script, and the efficiency of development, management and execution of the script can be improved.
According to the automatically generated test script set, the test scripts are automatically selected, the automatic test task is executed, manual participation is eliminated, and script execution efficiency is improved.
It should be clearly understood that this disclosure describes how to make and use particular examples, but the principles of this disclosure are not limited to any details of these examples. Rather, these principles can be applied to many other embodiments based on the teachings of the present disclosure.
FIG. 3 is a schematic diagram illustrating a web-based automated testing method according to another exemplary embodiment. The system can comprise a script library management module, a device access and identification module, a test script set management module, an automation control module, a report generation module and a log module. The following schematic diagram of an automated testing system:
a script library management module: the test scripts are managed by functional modules in a classified manner, for example, the routing management module is a routing table, a static route, a policy route, a unicast route, a multicast route, and the like, wherein the unicast route is divided into small modules according to each protocol. Generally, when a script is stored in a script library, the script is stored in different script directories according to different functions of the script. The script library management module is mainly responsible for adding, modifying and deleting scripts, and the work of testers is converted into a rich script library instead of compiling a test script set for each type of equipment.
The equipment access and identification module: after the automatic test system is connected with the equipment, automatically identifying the style and the model of the equipment through a set program, and storing the style and the model information of the equipment; after the operation is finished, the module automatically reads the function list in the device menu bar, generates a test script set main directory corresponding to the device style according to the function list of the device menu bar, and generates different test script sets aiming at different device information.
The test script collection management module: and automatically selecting a use case from the script library to generate a test script set for the equipment according to the test script set master catalog generated by the equipment access module, and managing the test script sets of the equipment of various models. For example: and the test script set management module reads a system monitoring function directory in the directory generated by the equipment identification and access module, selects the test scripts related to the system monitoring module from the automatic test script library and automatically synchronizes the test scripts to the generated system monitoring function directory, and each function module is traversed in such a way to generate a complete script test script set.
An automation control module: the test script set execution organization module executes the test script set scripts generated by the test script set management module according to a certain sequence, usually according to the catalog level from top to bottom.
A report generation module: the automatic control module is responsible for generating a test report after executing the test script set, and the automatic control module automatically generates a report in an html format after executing the complete test script set every time, so that the execution result of the test script set can be visually displayed.
The log module is mainly used for recording the case execution condition, and the failure log can find bugs existing in the equipment in time and is beneficial to optimizing and adjusting the automation process.
FIG. 4 is a flowchart illustrating a method for web-based automated testing, according to another exemplary embodiment. The flow 40 shown in fig. 4 is a detailed description of S206 "generating the test script set based on the web page function menu" in the flow shown in fig. 2.
As shown in fig. 4, in S402, a function directory is generated according to a display hierarchy in the web function menu.
In S404, the device functions in the function directory are traversed.
In S406, a script is extracted from the script library based on the basic information and the device function to generate the test script set.
In S408, the automated tests are performed one by one from top to bottom based on the levels corresponding to the device functions in the function directory.
And generating a test script set main directory according to the equipment information, automatically selecting a use case from a script library to generate a test script set for the equipment, and managing the test script set of each model of equipment. For example: and the test script set management module reads a system monitoring function directory in the directory generated by the equipment identification and access module, selects the test scripts related to the system monitoring module from the automatic test script library and automatically synchronizes the test scripts to the generated system monitoring function directory, and each function module is traversed in such a way to generate a complete script test script set.
The function list of the device to be tested may be automatically obtained through the tag as shown in fig. 5, and the corresponding directories are generated by dividing one by one according to the display hierarchy of the menu bar, for example, the directory may be generated according to the display of the left menu bar in fig. 5: basic-device monitoring-system monitoring, a directory of such a hierarchy.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments are implemented as computer programs executed by a CPU. When executed by the CPU, performs the functions defined by the above-described methods provided by the present disclosure. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods. For details not disclosed in the embodiments of the apparatus of the present disclosure, refer to the embodiments of the method of the present disclosure.
FIG. 6 is a block diagram illustrating a web-based automated testing apparatus according to another exemplary embodiment. As shown in fig. 6, the web-based automated testing apparatus 60 includes: an information module 602, a function module 604, an aggregation module 606, and a test module 608.
The information module 602 is configured to obtain basic information of a device to be tested, where the basic information includes a device name and a device model; the basic information of the device can be automatically identified, for example, according to a preset program.
The function module 604 is configured to obtain a web function menu of the device based on the basic information; the function module 604 is further configured to log in an equipment page of the equipment based on the basic information; and reading the webpage function menu from the equipment page.
The assembly module 606 is configured to generate the test script assembly based on the web page function menu; the aggregation module 606 is further configured to generate a function directory according to a display hierarchy in the web page function menu; and extracting scripts in a script library based on the function catalog to generate the test script set.
The test module 608 is configured to perform an automated test on the device based on the set of test scripts.
According to the automatic testing device based on the webpage, basic information of equipment to be tested is obtained, wherein the basic information comprises an equipment name and an equipment model; acquiring a webpage function menu of the equipment based on the basic information; generating the test script set based on the webpage function menu; the automatic testing mode of the equipment based on the test script set can optimize an automatic testing system based on a webpage, reduce the compiling time of the test script set and improve the automatic testing efficiency of new products and new models of equipment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
An electronic device 700 according to this embodiment of the disclosure is described below with reference to fig. 7. The electronic device 700 shown in fig. 7 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 is embodied in the form of a general purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one memory unit 720, a bus 730 that connects the various system components (including the memory unit 720 and the processing unit 710), a display unit 740, and the like.
Wherein the storage unit stores program code that can be executed by the processing unit 710 to cause the processing unit 710 to perform the steps according to various exemplary embodiments of the present disclosure described in this specification. For example, the processing unit 710 may perform the steps as shown in fig. 2 and 4.
The memory unit 720 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)7201 and/or a cache memory unit 7202, and may further include a read only memory unit (ROM) 7203.
The memory unit 720 may also include a program/utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 730 may be any representation of one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 700 may also communicate with one or more external devices 700' (e.g., keyboard, pointing device, bluetooth device, etc.), such that a user can communicate with devices with which the electronic device 700 interacts, and/or any devices (e.g., router, modem, etc.) with which the electronic device 700 can communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 750. Also, the electronic device 700 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 760. The network adapter 760 may communicate with other modules of the electronic device 700 via the bus 730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, as shown in fig. 8, the technical solution according to the embodiment of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, or a network device, etc.) to execute the above method according to the embodiment of the present disclosure.
The software product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The computer readable medium carries one or more programs which, when executed by a device, cause the computer readable medium to perform the functions of: acquiring basic information of equipment to be tested, wherein the basic information comprises an equipment name and an equipment model; acquiring a webpage function menu of the equipment based on the basic information; generating the test script set based on the webpage function menu; and automatically testing the equipment based on the test script set.
Those skilled in the art will appreciate that the modules described above may be distributed in the apparatus according to the description of the embodiments, or may be modified accordingly in one or more apparatuses unique from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Exemplary embodiments of the present disclosure are specifically illustrated and described above. It is to be understood that the present disclosure is not limited to the precise arrangements, instrumentalities, or instrumentalities described herein; on the contrary, the disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (11)

1. An automated testing method based on web pages is characterized by comprising the following steps:
acquiring basic information of equipment to be tested, wherein the basic information comprises an equipment name and an equipment model;
acquiring a webpage function menu of the equipment based on the basic information;
generating the test script set based on the webpage function menu;
and automatically testing the equipment based on the test script set.
2. The method of claim 1, wherein obtaining base information for a device under test comprises:
and automatically identifying basic information of the equipment according to a preset program.
3. The method of claim 1, wherein prior to obtaining the web page function menu of the device based on the base information, further comprising:
comparing the basic information with the basic information of a plurality of devices in a test script set library;
when the comparison is inconsistent, acquiring a webpage function menu of the equipment based on the basic information;
and when the comparison is consistent, extracting a corresponding test script set from the test script set library.
4. The method of claim 1, wherein obtaining a web page function menu for the device based on the base information comprises:
logging in an equipment page of the equipment based on the basic information;
and reading the webpage function menu from the equipment page.
5. The method of claim 4, wherein generating the set of test scripts based on the web page functionality menu comprises:
generating a function directory according to the display hierarchy in the webpage function menu;
and extracting scripts in a script library based on the function catalog to generate the test script set.
6. The method of claim 5, wherein extracting scripts in a script library based on the functional catalog to generate the set of test scripts comprises:
traversing the device functions in the function directory;
extracting scripts in the script library based on the basic information and the device functions to generate the test script set.
7. The method of claim 5, wherein automatically testing the device based on the set of test scripts comprises:
and carrying out automatic testing one by one from top to bottom based on the levels corresponding to the equipment functions in the function directory.
8. The method of claim 1, further comprising:
and storing the basic information and the corresponding test script set in the test script set library.
9. The method of claim 1, further comprising:
obtaining test scripts corresponding to the multiple devices;
and storing the test scripts in different script catalogues according to the types and protocols of the equipment to generate a script library.
10. The method of claim 9, further comprising:
and regularly maintaining the script library.
11. An automated testing device based on web pages, comprising:
the device comprises an information module, a test module and a test module, wherein the information module is used for acquiring basic information of equipment to be tested, and the basic information comprises an equipment name and an equipment model;
the function module is used for acquiring a webpage function menu of the equipment based on the basic information;
the collection module is used for generating the test script collection based on the webpage function menu;
and the testing module is used for carrying out automatic testing on the equipment based on the testing script set.
CN202110320530.4A 2021-03-25 2021-03-25 Automatic testing method and device based on webpage Pending CN112905483A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110320530.4A CN112905483A (en) 2021-03-25 2021-03-25 Automatic testing method and device based on webpage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110320530.4A CN112905483A (en) 2021-03-25 2021-03-25 Automatic testing method and device based on webpage

Publications (1)

Publication Number Publication Date
CN112905483A true CN112905483A (en) 2021-06-04

Family

ID=76106461

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110320530.4A Pending CN112905483A (en) 2021-03-25 2021-03-25 Automatic testing method and device based on webpage

Country Status (1)

Country Link
CN (1) CN112905483A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101237662A (en) * 2008-02-29 2008-08-06 深圳华为通信技术有限公司 Method and device for generating automatic test cases of mobile phone
US20110161912A1 (en) * 2009-12-30 2011-06-30 Qualzoom, Inc. System for creation and distribution of software applications usable on multiple mobile device platforms
CN104699616A (en) * 2015-03-31 2015-06-10 北京奇虎科技有限公司 Method, device and system for testing application
CN108920376A (en) * 2018-07-13 2018-11-30 北京京东金融科技控股有限公司 Test method, device and the medium of application program
CN108932194A (en) * 2018-06-21 2018-12-04 北京京东金融科技控股有限公司 Automated testing method, device, system, medium and electronic equipment
CN110362480A (en) * 2019-06-19 2019-10-22 平安普惠企业管理有限公司 Client buries a test method, device, equipment and storage medium
CN111984539A (en) * 2020-08-25 2020-11-24 北京微步在线科技有限公司 Automatic testing method and device for webpage front end
CN112231219A (en) * 2020-10-22 2021-01-15 中国平安人寿保险股份有限公司 Automatic test monitoring method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101237662A (en) * 2008-02-29 2008-08-06 深圳华为通信技术有限公司 Method and device for generating automatic test cases of mobile phone
US20110161912A1 (en) * 2009-12-30 2011-06-30 Qualzoom, Inc. System for creation and distribution of software applications usable on multiple mobile device platforms
CN104699616A (en) * 2015-03-31 2015-06-10 北京奇虎科技有限公司 Method, device and system for testing application
CN108932194A (en) * 2018-06-21 2018-12-04 北京京东金融科技控股有限公司 Automated testing method, device, system, medium and electronic equipment
CN108920376A (en) * 2018-07-13 2018-11-30 北京京东金融科技控股有限公司 Test method, device and the medium of application program
CN110362480A (en) * 2019-06-19 2019-10-22 平安普惠企业管理有限公司 Client buries a test method, device, equipment and storage medium
CN111984539A (en) * 2020-08-25 2020-11-24 北京微步在线科技有限公司 Automatic testing method and device for webpage front end
CN112231219A (en) * 2020-10-22 2021-01-15 中国平安人寿保险股份有限公司 Automatic test monitoring method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110309071B (en) Test code generation method and module, and test method and system
CN107729243B (en) Application programming interface automatic test method, system, equipment and storage medium
US20110123973A1 (en) Systems and methods for visual test authoring and automation
CN108763091B (en) Method, device and system for regression testing
US10885087B2 (en) Cognitive automation tool
CN113326247B (en) Cloud data migration method and device and electronic equipment
CN109872230B (en) Test method and device of financial data analysis system, medium and electronic equipment
CN110806970A (en) Client test method and device based on simulation server response and electronic equipment
CN109933509A (en) A kind of method and apparatus for realizing automatic test defect management
CN109408763B (en) Method and system for managing resume of different templates
CN110795181A (en) Application program interface display method and device based on skip protocol and electronic equipment
CN114138244A (en) Method and device for automatically generating model files, storage medium and electronic equipment
Ntentos et al. Semi-automatic feedback for improving architecture conformance to microservice patterns and practices
CN109460363B (en) Automatic testing method and device, electronic equipment and computer readable medium
CN112231197A (en) Page testing method and device and storage medium
CN113609008A (en) Test result analysis method and device and electronic equipment
US20190317877A1 (en) Application state monitoring
CN115576817A (en) Automatic test system, method, electronic equipment and storage medium
CN112905483A (en) Automatic testing method and device based on webpage
CN109697141B (en) Method and device for visual testing
CN112286802B (en) Method and device for testing program performance and electronic equipment
CN114385155A (en) vue project visualization tool generation method, device, equipment and storage medium
CN113934595A (en) Data analysis method and system, storage medium and electronic terminal
CN114238128A (en) Test case generation method and device, electronic equipment and computer readable medium
CN112328473A (en) Code automation integration test method and device and electronic equipment

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

Application publication date: 20210604

RJ01 Rejection of invention patent application after publication