CN112597058A - Web page testing method, device, equipment and storage medium based on volume creation - Google Patents

Web page testing method, device, equipment and storage medium based on volume creation Download PDF

Info

Publication number
CN112597058A
CN112597058A CN202110025551.3A CN202110025551A CN112597058A CN 112597058 A CN112597058 A CN 112597058A CN 202110025551 A CN202110025551 A CN 202110025551A CN 112597058 A CN112597058 A CN 112597058A
Authority
CN
China
Prior art keywords
volume
creation
test
result
test case
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
CN202110025551.3A
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.)
Beijing Udsafe Technology Co ltd
Original Assignee
Beijing Udsafe Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Udsafe Technology Co ltd filed Critical Beijing Udsafe Technology Co ltd
Priority to CN202110025551.3A priority Critical patent/CN112597058A/en
Publication of CN112597058A publication Critical patent/CN112597058A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems

Abstract

The invention discloses a webpage testing method, a webpage testing device and a webpage testing equipment based on volume creation and a storage medium. The method comprises the following steps: acquiring target volume parameters, volume types and volume creation modes, wherein the volume creation modes comprise: single creation or batch creation; generating a test case according to the target volume parameter, the volume type and the volume creation mode; when a creation instruction is detected, determining a volume creation result according to the test case; and determining the webpage test result of each test case according to the volume creation result. By the technical scheme, the volume creation and test can be executed on the basis of the existing storage and Web management resources of a storage enterprise, the test efficiency and the verification coverage rate of testers are improved, redundant test cases are reduced, and various test requirements of the creation of common volumes are easily met.

Description

Web page testing method, device, equipment and storage medium based on volume creation
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a webpage testing method, a webpage testing device, a webpage testing equipment and a webpage testing storage medium based on volume creation.
Background
The distributed file system is a popular storage system nowadays due to its characteristics of openness, processing capability of thousands of orders of magnitude of client, expandability, high performance, high availability, virtualized storage pool, etc.
Enterprises generally provide a Web management system for storage management and use while providing distributed storage for the outside. Before this, the storage enterprise needs to perform all-round verification on the Web management system to ensure the quality of service provided to the user. Especially, the creation of the volume becomes a functional core of storage management, and needs to be verified comprehensively and accurately.
In the prior art, when a tester executes the creation and test of a Web management system volume of a storage system, the tester basically depends on manual operation, so that the tester has high viscosity and high viscosity with the test content; and due to the specialty of the storage service, it is determined that the tester needs to be familiar with the service flow first and can execute the real volume creating process after effectively combining the page and the operation. Especially, when a full coverage test is executed, manpower and time are consumed, useless case loss can be guaranteed only by effectively summarizing and perfecting test cases, and meanwhile, non-overlapping or redundant cases are not easily guaranteed. And the test executed based on the interface can complete the creation but is completely separated from the browser, and the test case when the operation is executed based on the browser page cannot be verified.
Disclosure of Invention
The embodiment of the invention provides a webpage testing method, a device, equipment and a storage medium based on volume creation, so that the volume creation and testing can be executed on the basis of existing storage and Web management resources of a storage enterprise, the testing efficiency and the verification coverage rate of testers are improved, redundant test cases are reduced, and various testing requirements of common volume creation can be easily met.
In a first aspect, an embodiment of the present invention provides a web page testing method based on volume creation, including:
acquiring target volume parameters, volume types and volume creation modes, wherein the volume creation modes comprise: single creation or batch creation;
generating a test case according to the target volume parameter, the volume type and the volume creation mode;
when a creation instruction is detected, determining a volume creation result according to the test case;
and determining the webpage test result of each test case according to the volume creation result.
Further, the obtaining the target volume parameter and the volume type includes:
acquiring initial volume parameters and volume types, wherein the volume types comprise at least one of a distributed volume, a copy volume and an erasure code volume;
determining a volume attribute according to the volume type;
and determining target volume parameters according to the initial volume parameters and the volume attributes.
Further, the volume attributes of the distributed volume include: volume name, volume capacity, and number of storage blocks; the volume attributes of the copy volume include: volume name, volume capacity, number of copies and number of placed groups; the volume attributes of the erasure coded volume include: volume name, volume capacity, number of data blocks, and number of check blocks.
Further, generating a test case according to the target volume parameter, the volume type, and the volume creation mode includes:
obtaining an expected result of the target volume parameter;
if the volume creation mode is single creation, generating a first test case according to the target volume parameters and the expected result;
and if the volume creation mode is batch creation, generating at least two groups of second test cases according to the target volume parameters and the expected result.
Further, when the creation instruction is detected, determining a volume creation result according to the test case includes:
calling a Webdriver to execute webpage test operation according to the first test case or the second test case;
and after the test operation is finished, when a creation instruction is detected, executing volume creation to obtain a volume creation result.
Further, calling a Webdriver to execute a web test operation according to the first test case or the second test case, including:
according to the test case, a path expression or an element selector is adopted to position webpage elements, wherein the webpage elements comprise: at least one of a drop down list, an input box, a radio box, and a check box;
determining parameters to be input according to the test case;
and executing input or selection operation on the positioned page elements according to the parameters to be input.
Further, determining a web page test result of each test case according to the volume creation result includes:
matching the volume creation result with an expected result corresponding to each test case;
if the volume creation result is consistent with the expected result, determining that the webpage test result of the test case is passed;
and if the volume creation result is inconsistent with the expected result, determining that the webpage test result of the test case is failed.
In a second aspect, an embodiment of the present invention further provides a web page testing apparatus based on volume creation, where the apparatus includes:
an obtaining module, configured to obtain a target volume parameter, a volume type, and a volume creation mode, where the volume creation mode includes: single creation or batch creation;
the generating module is used for generating a test case according to the target volume parameter, the volume type and the volume creating mode;
a creation result determining module, configured to determine a volume creation result according to the test case and the volume creation mode when a creation instruction is detected;
and the test result determining module is used for determining the webpage test result of each test case according to the volume creating result.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the web page testing method based on volume creation according to any one of the embodiments of the present invention when executing the program.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the web page testing method based on volume creation according to any one of the embodiments of the present invention.
The embodiment of the invention generates the test case by acquiring the target volume parameter, the volume type and the volume creation mode; when a creation instruction is detected, determining a volume creation result according to the test case; the webpage test result of each test case is determined according to the volume creation result, the problem that manual operation is relied on for volume test and test is solved, the binding degree of a tester and test contents is high, particularly, when the comprehensive coverage test is executed, labor and time are consumed, no overlapping or redundant cases are not easy to guarantee, volume creation and test are executed on the basis of existing storage and Web management resources of a storage enterprise, the test efficiency and the verification coverage rate of the tester are improved, the redundant test cases are reduced, and various test requirements of common volume creation are easily met.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a flowchart of a web page testing method based on volume creation according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a web page testing method based on volume creation according to a second embodiment of the present invention;
FIG. 2a is a flowchart of another method for testing web pages based on volume creation according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a web page testing apparatus based on volume creation according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device in the fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
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, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example one
Fig. 1 is a flowchart of a web page testing method based on volume creation according to an embodiment of the present invention, where this embodiment is applicable to a case of web page testing for distributed storage, and the method may be executed by a web page testing apparatus based on volume creation according to an embodiment of the present invention, where the apparatus may be implemented in a software and/or hardware manner, as shown in fig. 1, the method specifically includes the following steps:
s110, obtaining target volume parameters, volume types and volume creation modes, wherein the volume creation modes comprise: single creation or batch creation.
The volume types may include, among others, distributed volumes, replica volumes, striped volumes, distributed replica volumes, and erasure coded volumes. The target volume parameter is a parameter value corresponding to each attribute of the volume. The volume attributes may be different for different volume types, and a volume attribute may contain multiple volume parameters. The volume creation mode refers to a mode of creating a volume, and is single creation or batch creation.
Specifically, the manner of obtaining the volume parameter, the volume type, and the volume creation mode may be to obtain the volume parameter, the volume type, and the volume creation mode input by the user, or may also be to provide the volume attribute for the user to receive the volume parameter corresponding to the volume attribute input by the user, provide a volume type menu and a volume creation mode menu for the user, and receive the volume type and the volume creation mode selected by the user.
The volume creation mode comprises the following steps: single creation or batch creation, both with different emphasis. The volume is created in a single creation mode, which is mainly suitable for a smoking test, that is, a group of common volume parameters are input to execute the creation of a plurality of volumes so as to test whether the basic functions of distributed storage can be realized and whether the flow is smooth, wherein the common volume parameters can be set according to actual requirements, for example, the common parameters are non-null values, non-zero values and no more than 10 characters. The volume creation by adopting the batch creation mode is mainly suitable for carrying out comprehensive coverage test on the distributed storage, belongs to comprehensive and careful test, and needs to cover a test scene as comprehensively as possible and discover all defects so as to comprehensively test various performances of the distributed storage. For example, the attributes of a volume may include a volume name, a volume capacity; the parameters corresponding to the volume name may include: null, contain special characters, or normal (i.e., non-null and not containing special characters); the parameters corresponding to the volume capacity may include: null, 0, excess platform storage total or normal (non-null, non-zero value and, not excess platform storage total).
And S120, generating a test case according to the target volume parameter, the volume type and the volume creation mode.
The test case is used for scientifically organizing and summarizing the behavior activity of the software test, and aims to convert the behavior of the software test into a manageable mode; meanwhile, the test case is also one of the methods for specifically quantifying the test. The selection of test cases directly affects the quality and efficiency of the test. The test case may or may not contain the expected result.
Specifically, after the volume creation mode is obtained, test cases corresponding to different volume types may be generated according to the volume type and the target volume parameter, or test cases corresponding to different volume types may be generated according to the volume type, the target volume parameter, and an expected result.
And S130, when the creation instruction is detected, determining a volume creation result according to the test case.
Wherein, the creating instruction can be any triggering instruction input by a user, for example, a triggering button; the creation instruction may also be automatically sent after the test case is generated.
Specifically, when a creation instruction is detected, a parameter value corresponding to the test case is input into an element corresponding to the webpage, and a volume creation result is determined. The volume creation result may be a volume creation success or a volume creation failure, and may be a reason or hint information of the volume creation failure, for example, "the volume name must not contain a special character", "the volume name length is too short", or "the volume capacity exceeds the total amount of platform storage".
S140, determining the webpage test result of each test case according to the volume creation result.
Specifically, the web page test result of each test case is determined by matching the volume creation result with the expected test result. If the volume creation result is consistent with the expected result, determining that the webpage test result of the test case is passed; and if the volume creation result is inconsistent with the expected result, determining that the webpage test result of the test case is failed.
According to the technical scheme of the embodiment, the test case is generated by acquiring the target volume parameter, the volume type and the volume creation mode; when a creation instruction is detected, determining a volume creation result according to the test case; the webpage test result of each test case is determined according to the volume creation result, the problem that manual operation is relied on for volume test and test is solved, the binding degree of a tester and test contents is high, particularly, when the comprehensive coverage test is executed, labor and time are consumed, no overlapping or redundant cases are not easy to guarantee, volume creation and test are executed on the basis of existing storage and Web management resources of a storage enterprise, the test efficiency and the verification coverage rate of the tester are improved, the redundant test cases are reduced, and various test requirements of common volume creation are easily met.
Example two
Fig. 2 is a flowchart of a web page testing method based on volume creation in a second embodiment of the present invention, where the embodiment is optimized based on the foregoing embodiment, and in the embodiment, the obtaining target volume parameters includes: acquiring initial volume parameters and volume types, wherein the volume types comprise at least one of a distributed volume, a copy volume and an erasure code volume; determining a volume attribute according to the volume type; and determining target volume parameters according to the initial volume parameters and the volume attributes.
As shown in fig. 2, the method of this embodiment specifically includes the following steps:
s210, obtaining initial volume parameters and volume types, wherein the volume types comprise at least one of a distributed volume, a copy volume and an erasure code volume.
Specifically, a unified created volume entry is provided for a user, initial volume parameters are acquired in an array form, and a volume type is input in a text form. The volume type includes at least one of a distributed volume, a replica volume, and an erasure coded volume.
For example, the volume type input by the user may be "distributed volume", "replica volume", or "erasure code volume", or the volume type input by the user may also be "distributed volume" and "replica volume", or the volume type input by the user may be "distributed volume", "replica volume", and "erasure code volume". The initial volume parameter entered by the user may be a volume name array of { empty, containing special characters, extra length, normal }, i.e., an element in the volume name array indicates a possible occurrence of a volume name. Wherein the normal value indicates that any special case of the volume name without any null, containing special characters and exceeding length exists.
Illustratively, the initial volume parameters obtained are shown in table 1. In table 1, the volume parameter corresponding to the volume attribute may be set according to actual requirements, for example, the length of the volume name is set to be no more than 10 characters, and the volume name does not contain special characters, such as "+", "%", "&" and ^ and the like.
TABLE 1
Figure BDA0002890196670000091
S220, determining the volume attribute according to the volume type.
Specifically, the manner of determining the volume attribute according to the volume type may be to determine the volume attribute of each volume type by querying a preset mapping relationship table between the volume type and the volume attribute according to the volume type, or may be to determine the volume attribute of each volume type by querying a preset database table between the volume type and the volume attribute according to the volume type, which is not limited in this embodiment of the present invention.
Optionally, the volume attributes of the distributed volume include: volume name, volume capacity, and number of storage blocks; the volume attributes of the copy volume include: volume name, volume capacity, number of copies and number of placed groups; the volume attributes of the erasure coded volume include: volume name, volume capacity, number of data blocks, and number of check blocks.
S230, determining target volume parameters according to the initial volume parameters and the volume attributes.
The target volume parameter refers to an initial volume parameter corresponding to a volume attribute of each volume type.
Specifically, after the volume type is determined, the target volume parameter corresponding to the volume attribute of each volume type is determined according to the one-to-one matching between the volume attribute of the volume type and the initial volume parameter.
Illustratively, the target volume parameters are shown in Table 2.
TABLE 2
Figure BDA0002890196670000101
S240, acquiring a volume creation mode, wherein the volume creation mode comprises: single creation or batch creation.
And S250, generating a test case according to the target volume parameter, the volume type and the volume creation mode.
Specifically, if the volume creation mode is single creation, test cases of different volume types are generated according to the normal values in the target volume parameters. And if the volume creation mode is batch creation, generating test cases of different volume types according to the target volume parameters.
For example, when the volume creation mode is single creation, the test case of the distributed volume is { volume name: normal value, volume capacity: normal value, number of memory blocks: normal value }; the test case of the replica volume is { volume name: normal value, volume capacity: normal value, number of copies: normal, number of placed groups: normal value }; the test case of the erasure code volume is { volume name: normal value, volume capacity: normal value, number of data blocks: normal values; the number of check blocks is as follows: normal value }. Optionally, generating a test case according to the target volume parameter, the volume type, and the volume creation mode includes:
obtaining an expected result of the target volume parameter;
if the volume creation mode is single creation, generating a first test case according to the target volume parameter and an expected result of the target volume parameter;
and if the volume creation mode is batch creation, generating at least two groups of second test cases according to the target volume parameters and the expected results of the target volume parameters.
Wherein the test case comprises target volume parameters and expected results.
Specifically, if the volume creation mode is single creation, generating first test cases of different volume types according to a normal value in a target volume parameter and an expected result of the target volume parameter; if the volume creation mode is batch creation, using a Pairwise algorithm to organize the test cases to generate at least two groups of second test cases according to the target volume parameters and the expected result, wherein the at least two groups of second test cases are comprehensive non-redundant test cases so as to cover program paths and function scenes by using relatively few cases.
For example, if the volume creation mode is single creation, the first test case of different volume types may be: the first test case of the distributed volume is { volume name: normal value, volume capacity: normal value, number of memory blocks: normal values, expected results: successful creation }, and the test case of the copy volume is { volume name: normal value, volume capacity: normal value, number of copies: normal, number of placed groups: normal values, expected results: creation success }; the test case of the erasure code volume is { volume name: normal value, volume capacity: normal value, number of data blocks: normal values; the number of check blocks is as follows: normal values, expected results: creation success }. And if the volume creation mode is batch creation, generating at least two groups of second test cases according to the target volume parameters and the expected results of the target volume parameters. If the volume creation mode is batch creation, the second test case of the distributed volume may be { volume name: empty, volume capacity: normal value, number of memory blocks: decimal value, expected result: creation failure, or may be { volume name: normal, volume capacity: 0, number of memory blocks: 0, expected result: creation failure }.
And S260, when the creation instruction is detected, determining a volume creation result according to the test case.
The volume creation result may be a volume creation success or a volume creation failure, and may be a reason or prompt information of the volume creation failure, for example, "the volume name must not contain a special character," the volume name length is too short, "or" the volume capacity exceeds the total storage amount of the platform.
Specifically, when a creation instruction is detected, volume creation results are sequentially determined according to a volume creation mode and a test case corresponding to a volume type. And if a plurality of volume types are simultaneously selected, determining a volume creation result according to the test case corresponding to each volume type in sequence. And if the volume creation mode is batch creation, sequentially determining creation results of at least two groups of test cases corresponding to each volume type.
For example, if the volume creation mode is single creation and the volume type is a distributed volume, the volume creation result is determined according to the first test case of the distributed volume. And if the volume creation mode is batch creation and the volume type is a copy volume, sequentially determining a volume creation result according to at least two second test cases of the copy volume.
Optionally, when the creation instruction is detected, determining a volume creation result according to the test case includes:
calling a Webdriver to execute webpage test operation according to the first test case or the second test case;
and after the test operation is finished, when a creation instruction is detected, executing volume creation to obtain a volume creation result.
Among them, Webdriver is a browser-based open source automated testing tool, also known as Selenium 2.
Specifically, if the volume creation mode is single creation, sequentially calling Webdriver to execute webpage test operation according to first test cases of different volume types; if the volume creation mode is batch creation, sequentially calling Webdriver to execute webpage test operation according to at least two groups of second test cases of different volume types; and after the test operation is finished, when a creation instruction is detected, volume creation is executed to obtain a volume creation result.
Optionally, the invoking Webdriver according to the first test case or the second test case to execute a web test operation includes:
according to the test case, a path expression or an element selector is adopted to position webpage elements, wherein the webpage elements comprise: at least one of a drop down list, an input box, a radio box, and a check box;
determining parameters to be input according to the test case;
and executing input or selection operation on the positioned page elements according to the parameters to be input.
The Webdriver comprises a plurality of positioning methods, a path expression (XMLPathLanguage, xpath) positioning method uses the path expression to select a node or a node set in an XML document to position a webpage element, and an element selector CCS method positions the webpage element through a CSS attribute value of the element.
Specifically, a path expression or an element selector in Webdriver is adopted to position the webpage elements according to the test cases, parameters to be input are randomly distributed by the system according to the test cases, and input or selection operation is performed on the positioned webpage elements according to the parameters to be input.
Illustratively, the test case is a distributed volume { volume name: containing special characters, volume capacity: normal value, number of memory blocks: and (4) a decimal value, randomly distributing parameters to be input matched with the test cases by the system, wherein the parameters are { volume name: volume a, volume capacity: 2GB, number of memory blocks: 2.1, enter "volume a" in the input box corresponding to the volume name, select 2GB in the drop-down list corresponding to the volume capacity, and enter 2.1 in the input box corresponding to the number of memory blocks.
S270, determining the webpage test result of each test case according to the volume creation result.
Specifically, the web page test result of each test case is determined according to the volume creation result and the expected result of each test case.
Optionally, determining the webpage test result of each test case according to the volume creation result includes:
matching the volume creation result with an expected result corresponding to each test case;
if the volume creation result is consistent with the expected result, determining that the webpage test result of the test case is passed;
and if the volume creation result is inconsistent with the expected result, determining that the webpage test result of the test case is failed.
The expected result of each test case may be included in the test case or may be obtained from the outside. Specifically, matching the volume creation result with an expected result corresponding to each test case; if the volume creation result is consistent with the expected result, determining that the webpage test result of the test case is passed; and if the volume creation result is inconsistent with the expected result, determining that the webpage test result of the test case is failed, thereby completing the webpage test based on the volume creation.
Exemplarily, if the expected result corresponding to the test case is creation failure and the volume creation result corresponding to the test case is creation success, determining that the webpage test result of the test case is failed; if the expected result corresponding to the test case is successful creation and the volume creation result corresponding to the test case is failed creation, determining that the webpage test result of the test case is failed; if the expected result corresponding to the test case is successful creation and the volume creation result corresponding to the test case is successful creation, determining that the webpage test result of the test case is passed; and if the expected result corresponding to the test case is the creation failure and the volume creation result corresponding to the test case is the creation failure, determining that the webpage test result of the test case is a pass.
As shown in fig. 2a, the specific steps of the embodiment of the present invention are: determining volume parameters corresponding to volume attributes of different volume types according to the initial volume parameters of the user number and the volume types, wherein the volume attributes of the distributed volume comprise: volume name, volume capacity, and number of storage blocks; the volume attributes of the copy volume include: volume name, volume capacity, number of copies and number of placed groups; the volume attributes of the erasure coded volume include: volume name, volume capacity, number of data blocks, and number of check blocks. The method for acquiring the volume creation mode input by the user comprises the following steps: and (3) single creation or batch creation, if the volume creation mode is single creation, determining the normal value of the volume parameter as a test case, and if the volume creation mode is batch creation, determining the test case according to a test case design strategy. Positioning a webpage element corresponding to each test case, wherein the webpage element comprises: at least one of a drop down list, an input box, a radio box, and a check box. And executing input or selection operation on the webpage elements according to the parameters corresponding to the test cases. And when a creation instruction is received, executing a creation volume to determine a volume creation result, and determining a webpage test result according to the creation volume creation result of the matching volume and the prediction result until the test cases all obtain the webpage test result, thereby completing the webpage test based on the volume creation.
According to the technical scheme of the embodiment, the test case is generated by acquiring the target volume parameter, the volume type and the volume creation mode; when a creation instruction is detected, determining a volume creation result according to the test case; the webpage test result of each test case is determined according to the volume creation result, the problem that manual operation is relied on for volume test and test is solved, the binding degree of a tester and test contents is high, particularly, when the comprehensive coverage test is executed, labor and time are consumed, no overlapping or redundant cases are not easy to guarantee, volume creation and test are executed on the basis of existing storage and Web management resources of a storage enterprise, the test efficiency and the verification coverage rate of the tester are improved, the redundant test cases are reduced, and various test requirements of common volume creation are easily met.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a web page testing apparatus based on volume creation according to a third embodiment of the present invention. The present embodiment is applicable to the case of web page testing for distributed storage, and the apparatus may be implemented in software and/or hardware, and the apparatus may be integrated in any device that provides a function of web page testing based on volume creation, as shown in fig. 3, where the apparatus for web page testing based on volume creation specifically includes: an acquisition module 310, a generation module 320, a creation result determination module 330, and a test result determination module 340.
The obtaining module 310 is configured to obtain a target volume parameter, a volume type, and a volume creating method, where the volume creating method includes: single creation or batch creation;
a generating module 320, configured to generate a test case according to the target volume parameter, the volume type, and the volume creation mode;
a creation result determining module 330, configured to determine a volume creation result according to the test case when a creation instruction is detected;
and the test result determining module 340 is configured to determine a web page test result of each test case according to the volume creation result.
Optionally, the obtaining module is specifically configured to:
acquiring initial volume parameters and volume types, wherein the volume types comprise at least one of a distributed volume, a copy volume and an erasure code volume;
determining a volume attribute according to the volume type;
and determining target volume parameters according to the initial volume parameters and the volume attributes.
Optionally, the volume attributes of the distributed volume include: volume name, volume capacity, and number of storage blocks; the volume attributes of the copy volume include: volume name, volume capacity, number of copies and number of placed groups; the volume attributes of the erasure coded volume include: volume name, volume capacity, number of data blocks, and number of check blocks.
Optionally, the generating module includes:
an acquisition unit configured to acquire an expected result of the target volume parameter;
a first generating unit, configured to generate a first test case according to the target volume parameter and the expected result if the volume creation mode is single creation;
and the second generating unit is used for generating at least two groups of second test cases according to the target volume parameters and the expected result if the volume creation mode is batch creation.
Optionally, the creation result determining module includes:
the webpage testing unit is used for calling the Webdriver to execute webpage testing operation according to the first test case or the second test case;
and the creating unit is used for executing volume creation to obtain a volume creation result when a creating instruction is detected after the test operation is finished.
Optionally, the web page testing unit is specifically configured to:
according to the test case, a path expression or an element selector is adopted to position webpage elements, wherein the webpage elements comprise: at least one of a drop down list, an input box, a radio box, and a check box;
determining parameters to be input according to the test case;
and executing input or selection operation on the positioned page elements according to the parameters to be input.
Optionally, the test result determining module includes:
the matching unit is used for matching the volume creation result with the expected result corresponding to each test case;
the first determining unit is used for determining that the webpage test result of the test case passes if the volume creation result is consistent with the expected result;
and the second determining unit is used for determining that the webpage test result of the test case is failed if the volume creation result is inconsistent with the expected result.
The product can execute the method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
According to the technical scheme of the embodiment, the test case is generated by acquiring the target volume parameter, the volume type and the volume creation mode; when a creation instruction is detected, determining a volume creation result according to the test case; the webpage test result of each test case is determined according to the volume creation result, the problem that manual operation is relied on for volume test and test is solved, the binding degree of a tester and test contents is high, particularly, when the comprehensive coverage test is executed, labor and time are consumed, no overlapping or redundant cases are not easy to guarantee, volume creation and test are executed on the basis of existing storage and Web management resources of a storage enterprise, the test efficiency and the verification coverage rate of the tester are improved, the redundant test cases are reduced, and various test requirements of common volume creation are easily met.
Example four
Fig. 4 is a schematic structural diagram of a computer device in the fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in FIG. 4 is only one example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 4, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. In the computer device 12 of the present embodiment, the display 24 is not provided as a separate body but is embedded in the mirror surface, and when the display surface of the display 24 is not displayed, the display surface of the display 24 and the mirror surface are visually integrated. Also, computer device 12 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 network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computer device 12, 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.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, implementing a web page test method based on volume creation provided by the embodiment of the present invention:
acquiring target volume parameters, volume types and volume creation modes, wherein the volume creation modes comprise: single creation or batch creation;
generating a test case according to the target volume parameter, the volume type and the volume creation mode;
when a creation instruction is detected, determining a volume creation result according to the test case;
and determining the webpage test result of each test case according to the volume creation result.
EXAMPLE five
An embodiment five of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a web page testing method based on volume creation, as provided in all inventive embodiments of the present application:
acquiring target volume parameters, volume types and volume creation modes, wherein the volume creation modes comprise: single creation or batch creation;
generating a test case according to the target volume parameter, the volume type and the volume creation mode;
when a creation instruction is detected, determining a volume creation result according to the test case;
and determining the webpage test result of each test case according to the volume creation result.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer 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 computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer 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 computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable 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.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, 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 computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A web page testing method based on volume creation is characterized by comprising the following steps:
acquiring target volume parameters, volume types and volume creation modes, wherein the volume creation modes comprise: single creation or batch creation;
generating a test case according to the target volume parameter, the volume type and the volume creation mode;
when a creation instruction is detected, determining a volume creation result according to the test case;
and determining the webpage test result of each test case according to the volume creation result.
2. The method of claim 1, wherein obtaining target volume parameters and volume type comprises:
acquiring initial volume parameters and volume types, wherein the volume types comprise at least one of a distributed volume, a copy volume and an erasure code volume;
determining a volume attribute according to the volume type;
and determining target volume parameters according to the initial volume parameters and the volume attributes.
3. The method of claim 2, wherein the volume attributes of the distributed volume comprise: volume name, volume capacity, and number of storage blocks; the volume attributes of the copy volume include: volume name, volume capacity, number of copies and number of placed groups; the volume attributes of the erasure coded volume include: volume name, volume capacity, number of data blocks, and number of check blocks.
4. The method of claim 1, wherein generating test cases according to the target volume parameters, the volume type, and the volume creation mode comprises:
obtaining an expected result of the target volume parameter;
if the volume creation mode is single creation, generating a first test case according to the target volume parameters and the expected result;
and if the volume creation mode is batch creation, generating at least two groups of second test cases according to the target volume parameters and the expected result.
5. The method according to claim 4, wherein the determining a volume creation result according to the test case when the creation instruction is detected comprises:
calling a Webdriver to execute webpage test operation according to the first test case or the second test case;
and after the test operation is finished, when a creation instruction is detected, executing volume creation to obtain a volume creation result.
6. The method of claim 5, wherein invoking Webdriver according to the first test case or the second test case to perform a webpage test operation comprises:
according to the test case, a path expression or an element selector is adopted to position webpage elements, wherein the webpage elements comprise: at least one of a drop down list, an input box, a radio box, and a check box;
determining parameters to be input according to the test case;
and executing input or selection operation on the positioned page elements according to the parameters to be input.
7. The method of claim 1, wherein determining the web page test results for each test case from the volume creation results comprises:
matching the volume creation result with an expected result corresponding to each test case;
if the volume creation result is consistent with the expected result, determining that the webpage test result of the test case is passed;
and if the volume creation result is inconsistent with the expected result, determining that the webpage test result of the test case is failed.
8. A web page test apparatus based on volume creation, comprising:
an obtaining module, configured to obtain a target volume parameter, a volume type, and a volume creation mode, where the volume creation mode includes: single creation or batch creation;
the generating module is used for generating a test case according to the target volume parameter, the volume type and the volume creating mode;
a creation result determining module, configured to determine a volume creation result according to the test case and the volume creation mode when a creation instruction is detected;
and the test result determining module is used for determining the webpage test result of each test case according to the volume creating result.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-7 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202110025551.3A 2021-01-08 2021-01-08 Web page testing method, device, equipment and storage medium based on volume creation Pending CN112597058A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110025551.3A CN112597058A (en) 2021-01-08 2021-01-08 Web page testing method, device, equipment and storage medium based on volume creation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110025551.3A CN112597058A (en) 2021-01-08 2021-01-08 Web page testing method, device, equipment and storage medium based on volume creation

Publications (1)

Publication Number Publication Date
CN112597058A true CN112597058A (en) 2021-04-02

Family

ID=75207302

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110025551.3A Pending CN112597058A (en) 2021-01-08 2021-01-08 Web page testing method, device, equipment and storage medium based on volume creation

Country Status (1)

Country Link
CN (1) CN112597058A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9348569B1 (en) * 2012-09-11 2016-05-24 Emc Corporation Method and system for a configurable automation framework
US20160357661A1 (en) * 2015-06-08 2016-12-08 International Business Machines Corporation Automated dynamic test case generation
CN111124773A (en) * 2019-11-22 2020-05-08 苏州浪潮智能科技有限公司 Batch volume IO read-write test method, system and equipment based on vdbech
CN111181781A (en) * 2019-12-21 2020-05-19 苏州浪潮智能科技有限公司 Vdbench test configuration method, system, terminal and storage medium
CN112162927A (en) * 2020-10-13 2021-01-01 网易(杭州)网络有限公司 Test method, medium and device of cloud computing platform and computing equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9348569B1 (en) * 2012-09-11 2016-05-24 Emc Corporation Method and system for a configurable automation framework
US20160357661A1 (en) * 2015-06-08 2016-12-08 International Business Machines Corporation Automated dynamic test case generation
CN111124773A (en) * 2019-11-22 2020-05-08 苏州浪潮智能科技有限公司 Batch volume IO read-write test method, system and equipment based on vdbech
CN111181781A (en) * 2019-12-21 2020-05-19 苏州浪潮智能科技有限公司 Vdbench test configuration method, system, terminal and storage medium
CN112162927A (en) * 2020-10-13 2021-01-01 网易(杭州)网络有限公司 Test method, medium and device of cloud computing platform and computing equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JUNZAN ZHOU等: "Automated Model-Based Performance Testing for PaaS Cloud Services", 《2014 IEEE 38TH INTERNATIONAL COMPUTER SOFTWARE AND APPLICATIONS CONFERENCE WORKSHOPS》, 22 September 2014 (2014-09-22), pages 644 - 649 *
赵雷: "块设备自动化测试系统的设计及优化", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 April 2018 (2018-04-15), pages 137 - 144 *

Similar Documents

Publication Publication Date Title
CN108073519B (en) Test case generation method and device
US10726356B1 (en) Target variable distribution-based acceptance of machine learning test data sets
CN111506498A (en) Automatic generation method and device of test case, computer equipment and storage medium
CN109739855B (en) Method and system for realizing data sheet splicing and automatically training machine learning model
CN114416667B (en) Method and device for rapidly sharing network disk file, network disk and storage medium
CN110990411B (en) Data structure generation method and device, and calling method and device
CN111813804B (en) Data query method and device, electronic equipment and storage medium
CN107797933B (en) Method and device for generating simulation message
CN112860777B (en) Data processing method, device and equipment
CN112685029A (en) Visual template generation method, device, equipment and storage medium
CN110688111A (en) Configuration method, device, server and storage medium of business process
CN110955640A (en) Cross-system data file processing method, device, server and storage medium
CN109408361A (en) Monkey tests restored method, device, electronic equipment and computer readable storage medium
US9037597B2 (en) Verifying file versions in a networked computing environment
CN116644250B (en) Page detection method, page detection device, computer equipment and storage medium
CN113836014A (en) Interface testing method and device, electronic equipment and storage medium
CN111367813B (en) Automatic testing method and device for decision engine, server and storage medium
CN114780497B (en) Batch file processing method, apparatus, computer device, medium, and program product
CN114266170B (en) Gas supply range identification method and device in gas distribution pipe network
CN115408358A (en) Network disk online file management method and device, network disk and storage medium
CN112597058A (en) Web page testing method, device, equipment and storage medium based on volume creation
US11714855B2 (en) Virtual dialog system performance assessment and enrichment
CN113760696A (en) Program problem positioning method and device, electronic equipment and storage medium
CN113590564A (en) Data storage method and device, electronic equipment and storage medium
CN110750569A (en) Data extraction method, device, 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