CN112597058B - Webpage testing method, device, equipment and storage medium based on volume creation - Google Patents
Webpage testing method, device, equipment and storage medium based on volume creation Download PDFInfo
- Publication number
- CN112597058B CN112597058B CN202110025551.3A CN202110025551A CN112597058B CN 112597058 B CN112597058 B CN 112597058B CN 202110025551 A CN202110025551 A CN 202110025551A CN 112597058 B CN112597058 B CN 112597058B
- 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.)
- Active
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 292
- 238000000034 method Methods 0.000 claims abstract description 26
- 238000001545 Page's trend test Methods 0.000 claims description 15
- 238000004590 computer program Methods 0.000 claims description 6
- 238000012795 verification Methods 0.000 abstract description 8
- 230000003287 optical effect Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000006399 behavior Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- BUGBHKTXTAQXES-UHFFFAOYSA-N Selenium Chemical compound [Se] BUGBHKTXTAQXES-UHFFFAOYSA-N 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 229910052711 selenium Inorganic materials 0.000 description 1
- 239000011669 selenium Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000000391 smoking effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a webpage testing method, device and equipment based on volume creation and a storage medium. The method comprises the following steps: obtaining a target volume parameter, a volume type and a volume creation mode, wherein the volume creation mode comprises the following steps: 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, volume creation and testing can be executed on the basis of existing storage and Web management resources of storage enterprises, testing efficiency and verification coverage rate of testers are improved, redundant test cases are reduced, and various testing requirements of common volume creation are met easily.
Description
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a web page testing method, device and equipment based on volume creation and a storage medium.
Background
Distributed file systems are becoming a popular storage system nowadays due to their open source, thousands of clients' processing capabilities, scalability, high performance, high availability, virtualized storage pools, etc.
Enterprises generally provide a Web management system for storage management and use while providing distributed storage. Before that, the storage enterprise needs to perform omnibearing verification on the Web management system so as to ensure the quality of service provided for the user. In particular, the creation of volumes becomes a functional core for storage management, requiring comprehensive and accurate verification.
In the prior art, when a tester executes the creation and testing of a Web management system volume of a storage system, the tester basically relies on manual operation, so that the binding degree of the tester and test contents is high and the viscosity is high; and due to the professional nature of the storage service, the test personnel is determined to be familiar with the service flow first, and the process of actually creating the volume can be executed after effectively combining the page and the operation. Especially, when the whole coverage test is executed, labor and time are consumed, and the test cases are effectively summarized and perfected to ensure that no useless cases are missing, and meanwhile, no overlapping or redundant cases are difficult to ensure. The test can be completed based on the interface, but the test can be completely separated from the browser, and the test case can not be verified when the operation is performed based on the browser page.
Disclosure of Invention
The embodiment of the invention provides a webpage test method, device, equipment and storage medium based on volume creation, which are used for realizing the execution of volume creation and test on the basis of the existing storage and Web management resources of a storage enterprise, improving the test efficiency and verification coverage rate of testers, reducing redundant test cases and easily coping with various test requirements of common volume creation.
In a first aspect, an embodiment of the present invention provides a web page testing method based on volume creation, including:
obtaining a target volume parameter, a volume type and a volume creation mode, wherein the volume creation mode comprises the following steps: 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 distributed volumes, duplicate volumes and erasure code volumes;
determining a volume attribute according to the volume type;
and determining a target volume parameter according to the initial volume parameter and the volume attribute.
Further, the volume attributes of the distributed volume include: volume name, volume capacity, and number of storage blocks; the volume attributes of the replica volume include: volume name, volume capacity, number of copies and number of placement groups; the volume attributes of the erasure coded volume include: volume name, volume capacity, number of data blocks, and number of parity 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, including:
Executing webpage test operation according to the first test case or the second test case call Webdriver;
after the test operation is finished, when a creation instruction is detected, executing volume creation to obtain a volume creation result.
Further, executing the web page test operation according to the first test case or the second test case call Webdriver includes:
According to the test case, positioning the webpage element by adopting a path expression or an element selector, wherein the webpage element comprises: 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 cases;
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, including:
matching the volume creation result with the 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 passing;
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:
The system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring target volume parameters, volume types and volume creation modes, and the volume creation modes comprise: single creation or batch creation;
The generation module is used for generating a test case according to the target volume parameter, the volume type and the volume creation mode;
the creation result determining module is used for determining a volume creation result according to the test case and the volume creation mode when the 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 creation 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 capable of running on the processor, where the processor implements the method for testing web pages based on volume creation according to any one of the embodiments of the present invention when the processor executes the program.
In a fourth aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for testing web pages based on volume creation according to any of the embodiments of the present invention.
The embodiment of the invention obtains the target volume parameters, the volume type and the volume creation mode and generates a test case; when a creation instruction is detected, determining a volume creation result according to the test case; the Web page test result of each test case is determined according to the volume creation result, the problem that the volume test and the test depend on manual operation is solved, the binding degree of a tester and test contents is high in viscosity, particularly, when the whole coverage test is executed, labor and time are consumed, no overlapping or redundant cases are not easy to guarantee, the volume creation and the test are executed on the basis of existing storage and Web management resources of storage enterprises, 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 that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a web page testing method based on volume creation in accordance with a first embodiment of the present invention;
FIG. 2 is a flow chart of a web page testing method based on volume creation in a second embodiment of the invention;
FIG. 2a is a flow chart of another web page testing method based on volume creation in a second embodiment of the invention;
FIG. 3 is a schematic diagram of a web page testing device based on volume creation in accordance with a third embodiment of the present invention;
Fig. 4 is a schematic structural diagram of a computer device in a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Example 1
Fig. 1 is a flowchart of a web page testing method based on volume creation according to an embodiment of the present invention, where the method may be applied to the case of web page testing of distributed storage, and the method may be performed by a web page testing device based on volume creation according to an embodiment of the present invention, and the device may be implemented in a software and/or hardware manner, as shown in fig. 1, and the method specifically includes the following steps:
S110, acquiring a target volume parameter, a volume type and a volume creation mode, wherein the volume creation mode comprises the following steps: single creation or batch creation.
Among other types of volumes, the volume types may include distributed volumes, duplicate volumes, striped volumes, distributed duplicate volumes, and erasure coded volumes. The target volume parameter is a parameter value corresponding to each attribute of the volume. Volume attributes for different volume types may differ, and one volume attribute may contain multiple volume parameters. The volume creation mode refers to a mode of creating volumes, single creation or batch creation.
Specifically, the manner of acquiring the volume parameter, the volume type and the volume creation manner may be to acquire the volume parameter, the volume type and the volume creation manner input by the user, or may be to provide the volume attribute for the user to receive the volume parameter corresponding to the volume attribute input by the user, provide the volume type menu and the volume creation manner menu for the user, and receive the volume type and the volume creation manner selected by the user.
The volume creation method comprises the following steps: single creation or batch creation, with different emphasis on the two. The method for creating the volume by adopting the single creation mode is mainly suitable for smoking test, namely, 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 or not and whether the flow is smooth or not, 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 not more than 10 characters. The volume is created by adopting a batch creation mode, which is mainly suitable for carrying out full coverage test on the distributed storage, belongs to comprehensive and detailed test, needs to be as full coverage test scenes as possible, and discovers all defects so as to comprehensively test each performance of the distributed storage. By way of example, the attributes of a volume may include volume name, volume capacity; the parameters corresponding to the volume name may include: null, containing special characters, or normal values (i.e., non-null and containing no special characters); the parameters corresponding to volume capacity may include: null, 0, exceeding the plateau store total or normal (non-null, non-zero and not exceeding the plateau store total).
S120, generating a test case according to the target volume parameter, the volume type and the volume creation mode.
The test case is to make a scientific organization summary of the behavior activity of the software test, and the purpose is to convert the behavior of the software test into a manageable mode; meanwhile, the test case is one of methods for quantifying the test. The choice of test cases directly affects the quality and efficiency of the test. The test cases may or may not include expected results.
Specifically, after the volume creation mode is acquired, 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.
S130, when a creation instruction is detected, determining a volume creation result according to the test case.
Wherein, the creation instruction can be input by a user with any trigger instruction, such as a trigger button; the creation instruction may also be automatically sent after the test case is generated.
Specifically, when the creation instruction is detected, the parameter value corresponding to the test case is input into the element corresponding to the webpage, and the volume creation result is determined. The volume creation result may be a volume creation success or a volume creation failure, and may be a cause or hint of the volume creation failure, for example, "volume name must not contain special characters", "volume name length is too short", or "volume capacity exceeds the total number of platform storage".
S140, determining the webpage test result of each test case according to the volume creation result.
Specifically, matching is performed according to the volume creation result and the expected test result, and the webpage test result of each test case is determined. If the volume creation result is consistent with the expected result, determining that the webpage test result of the test case is passing; 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, the target volume parameters, the volume types and the volume creation mode are obtained, and a test case is generated; when a creation instruction is detected, determining a volume creation result according to the test case; the Web page test result of each test case is determined according to the volume creation result, the problem that the volume test and the test depend on manual operation is solved, the binding degree of a tester and test contents is high in viscosity, particularly, when the whole coverage test is executed, labor and time are consumed, no overlapping or redundant cases are not easy to guarantee, the volume creation and the test are executed on the basis of existing storage and Web management resources of storage enterprises, 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, which is optimized based on the foregoing embodiment, and in this embodiment, the obtaining target volume parameters includes: acquiring initial volume parameters and volume types, wherein the volume types comprise at least one of distributed volumes, duplicate volumes and erasure code volumes; determining a volume attribute according to the volume type; and determining a target volume parameter according to the initial volume parameter and the volume attribute.
As shown in fig. 2, the method of this embodiment specifically includes the following steps:
S210, acquiring initial volume parameters and volume types, wherein the volume types comprise at least one of distributed volumes, duplicate volumes and erasure code volumes.
Specifically, a unified creation volume entry is provided for a user, initial volume parameters are acquired in an array form, and volume types are 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 user-entered volume type may be "distributed volume", "replica volume", or "erasure code volume", or the user-entered volume type may also be "distributed volume" and "replica volume", or the user-entered volume type may be "distributed volume", "replica volume", and "erasure code volume". The initial volume parameter entered by the user may be that the volume name array is { empty, contains special characters, exceeds length, normal }, i.e., the elements in the volume name array represent the volume name may appear. Wherein the normal value indicates any special case that the volume name does not exist empty, contains special characters and exceeds the length.
Illustratively, the initial volume parameters obtained are shown in Table 1. In table 1, the volume parameters corresponding to the volume attributes may be set according to actual requirements, for example, the length of the volume name is set to be not more than 10 characters, and the volume name does not contain special characters, for example, "x", "%", "&" and "ζ", etc.
TABLE 1
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 query a mapping relationship table of a preset volume type and a volume attribute according to the volume type to determine the volume attribute of each volume type, or may be to query a database table of a preset volume type and a volume attribute according to the volume type to determine the volume attribute of each volume type, which is not limited in this embodiment of the present invention.
Optionally, the volume attribute of the distributed volume includes: volume name, volume capacity, and number of storage blocks; the volume attributes of the replica volume include: volume name, volume capacity, number of copies and number of placement groups; the volume attributes of the erasure coded volume include: volume name, volume capacity, number of data blocks, and number of parity blocks.
S230, determining a target volume parameter according to the initial volume parameter and the volume attribute.
The target volume parameter refers to an initial volume parameter corresponding to a volume attribute of each volume type.
Specifically, after determining the volume type, determining a target volume parameter corresponding to the volume attribute of each volume type according to the one-to-one matching of the volume attribute of the volume type with the initial volume parameter.
Exemplary target volume parameters are shown in table 2.
TABLE 2
S240, acquiring a volume creation mode, wherein the volume creation mode comprises the following steps: single creation or batch creation.
S250, generating a test case according to the target volume parameters, 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 cases for replica volumes are { volume name: normal value, volume capacity: normal value, copy number: normal value, number of groups placed: normal value }; the test case of erasure code volume is { volume name: normal value, volume capacity: normal value, number of data blocks: normal values; checking the number of blocks: normal value }. Optionally, generating the 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 expected results of the target volume parameters.
Wherein the test case includes 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 normal values in target volume parameters and expected results of the target volume parameters; if the volume creation mode is batch creation, the test cases are organized by using a Pairwise algorithm, at least two groups of second test cases are generated according to target volume parameters and expected results, and the at least two groups of second test cases are comprehensive test cases without redundancy, so that program paths and functional scenes are covered by using relatively few cases.
For example, if the volume creation manner is a single creation, the first test cases of different volume types may be: the first test case for a distributed volume is { volume name: normal value, volume capacity: normal value, number of memory blocks: normal values, expected results: creation success }, test cases for duplicate volumes are { volume name: normal value, volume capacity: normal value, copy number: normal value, number of groups placed: normal values, expected results: creation success }; the test case of erasure code volume is { volume name: normal value, volume capacity: normal value, number of data blocks: normal values; checking the number of blocks: 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 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, expected outcome: creation failure }, or may be { volume name: normal volume capacity: 0, number of memory blocks: 0, expected outcome: creation failure }.
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 cause or hint of the volume creation failure, for example, "volume name must not contain special characters", "volume name length is too short", or "volume capacity exceeds the total number of platform storage.
Specifically, when the creation instruction is detected, the volume creation result is sequentially determined according to the volume creation mode and the test cases corresponding to the volume type. If multiple volume types are selected at the same time, determining a volume creation result according to the test cases corresponding to each volume type in sequence. If the volume creation mode is batch creation, sequentially determining creation results for 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, determining a volume creation result according to a first test case of the distributed volume. 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:
Executing webpage test operation according to the first test case or the second test case call Webdriver;
after the test operation is finished, when a creation instruction is detected, executing volume creation to obtain a volume creation result.
Wherein Webdriver is a browser-based open source automated test tool, also known as Selenium.
Specifically, if the volume creation mode is single creation, sequentially calling Webdriver to execute the webpage test operation according to the 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; after the test operation is completed, when a creation instruction is detected, volume creation is performed to obtain a volume creation result.
Optionally, the executing the web page test operation according to the first test case or the second test case call Webdriver includes:
According to the test case, positioning the webpage element by adopting a path expression or an element selector, wherein the webpage element comprises: 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 cases;
and executing input or selection operation on the positioned page elements according to the parameters to be input.
The Webdriver includes a plurality of positioning methods, the path expression (XMLPathLanguage, xpath) positioning method uses the path expression to select a node or a node set in the XML document to position the web page element, and the element selector CCS method positions the web page element through the CSS attribute value of the element.
Specifically, the path expression or the element selector in Webdriver is adopted to locate the webpage element according to the test case, the parameter to be input is randomly distributed by the system according to the test case, and the input or selection operation is executed on the located webpage element according to the parameter to be input.
Illustratively, the test case is a distributed volume { volume name: containing special characters, volume capacity: normal value, number of memory blocks: decimal value }, the parameters to be input matched by the system random allocation test case are { volume name: volume a, volume capacity: 2GB, number of memory blocks: 2.1}, the "volume x a" is entered in the entry box corresponding to the volume name, 2GB is selected in the drop-down list corresponding to the volume capacity, and 2.1 is entered in the entry box corresponding to the number of storage 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 web page test result of each test case according to the volume creation result includes:
matching the volume creation result with the 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 passing;
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 contained in the test case or may be obtained from the outside. Specifically, matching a 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 passing; 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 volume creation.
If the expected result corresponding to the test case is that the creation fails, and the volume creation result corresponding to the test case is that the creation is successful, determining that the web page test result of the test case is failed; if the expected result corresponding to the test case is successful in creation, the volume creation result corresponding to the test case is failed in creation, and the webpage test result of the test case is determined to be failed; if the expected result corresponding to the test case is successful in creation, the volume creation result corresponding to the test case is successful in creation, and the webpage test result of the test case is determined to pass; if the expected result corresponding to the test case is the creation failure, the volume creation result corresponding to the test case is the creation failure, and the web page test result of the test case is determined to 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 initial volume parameters and volume types of the number of users, wherein the volume attributes of the distributed volume comprise: volume name, volume capacity, and number of storage blocks; the volume attributes of the replica volume include: volume name, volume capacity, number of copies and number of placement groups; the volume attributes of the erasure coded volume include: volume name, volume capacity, number of data blocks, and number of parity 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 the 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 receiving the creation instruction, executing the creation volume to determine a volume creation result, and determining a webpage test result according to the matched volume creation result and the prediction result until the test cases all obtain the webpage test result, thereby completing the webpage test based on volume creation.
According to the technical scheme, the target volume parameters, the volume types and the volume creation mode are obtained, and a test case is generated; when a creation instruction is detected, determining a volume creation result according to the test case; the Web page test result of each test case is determined according to the volume creation result, the problem that the volume test and the test depend on manual operation is solved, the binding degree of a tester and test contents is high in viscosity, particularly, when the whole coverage test is executed, labor and time are consumed, no overlapping or redundant cases are not easy to guarantee, the volume creation and the test are executed on the basis of existing storage and Web management resources of storage enterprises, 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 device based on volume creation according to a third embodiment of the present invention. The present embodiment may be applicable to the case of web page testing in distributed storage, where 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: the system comprises 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 creation manner, where the volume creation manner 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;
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 acquiring module is specifically configured to:
acquiring initial volume parameters and volume types, wherein the volume types comprise at least one of distributed volumes, duplicate volumes and erasure code volumes;
determining a volume attribute according to the volume type;
and determining a target volume parameter according to the initial volume parameter and the volume attribute.
Optionally, the volume attribute of the distributed volume includes: volume name, volume capacity, and number of storage blocks; the volume attributes of the replica volume include: volume name, volume capacity, number of copies and number of placement groups; the volume attributes of the erasure coded volume include: volume name, volume capacity, number of data blocks, and number of parity blocks.
Optionally, the generating module includes:
The acquisition unit is used for acquiring the expected result of the target volume parameter;
the first generation unit is used for generating 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 creating mode is batch creation.
Optionally, the creation result determining module includes:
The webpage test unit is used for executing webpage test operation according to the first test case or the second test case call Webdriver;
And the creation unit is used for executing the volume creation to obtain a volume creation result when the creation instruction is detected after the test operation is completed.
Optionally, the web page testing unit is specifically configured to:
According to the test case, positioning the webpage element by adopting a path expression or an element selector, wherein the webpage element comprises: 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 cases;
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 the corresponding functional modules and beneficial effects of the execution method.
According to the technical scheme, the target volume parameters, the volume types and the volume creation mode are obtained, and a test case is generated; when a creation instruction is detected, determining a volume creation result according to the test case; the Web page test result of each test case is determined according to the volume creation result, the problem that the volume test and the test depend on manual operation is solved, the binding degree of a tester and test contents is high in viscosity, particularly, when the whole coverage test is executed, labor and time are consumed, no overlapping or redundant cases are not easy to guarantee, the volume creation and the test are executed on the basis of existing storage and Web management resources of storage enterprises, 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 IV
Fig. 4 is a schematic structural diagram of a computer device according to a 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 merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in FIG. 4, the computer device 12 is in the form of a general purpose computing device. Components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include 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 can 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. The 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 or write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard disk drive"). Although not shown in fig. 4, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules 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 in, for example, 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 or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and/or any devices (e.g., network card, modem, etc.) that enable the computer device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. In addition, in the computer device 12 of the present embodiment, the display 24 is not present as a separate body but is embedded in the mirror surface, and the display surface of the display 24 and the mirror surface are visually integrated when the display surface of the display 24 is not displayed. Moreover, computer device 12 may also communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with computer device 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing the web page test method based on volume creation provided by the embodiment of the present invention:
obtaining a target volume parameter, a volume type and a volume creation mode, wherein the volume creation mode comprises the following steps: 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
A fifth embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a web page testing method based on volume creation as provided by all embodiments of the present application:
obtaining a target volume parameter, a volume type and a volume creation mode, wherein the volume creation mode comprises the following steps: 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. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 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.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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 of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.
Claims (9)
1. A web page testing method based on volume creation, comprising:
obtaining a target volume parameter, a volume type and a volume creation mode, wherein the volume creation mode comprises the following steps: 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;
Determining a webpage test result of each test case according to the volume creation result;
generating a test case according to the target volume parameter, the volume type and the volume creation mode, including:
Obtaining an expected result of the target volume parameter;
If the volume creation mode is single creation, generating first test cases of different volume types according to normal values in target volume parameters and expected results of the target volume parameters; the normal value is a non-null value and does not contain special characters;
If the volume creation mode is batch creation, the test cases are organized by using a Pairwise algorithm, and at least two groups of second test cases are generated according to target volume parameters and expected results, wherein the at least two groups of second test cases are comprehensive test cases without redundancy.
2. The method of claim 1, wherein the obtaining the target volume parameter and the volume type comprises:
acquiring initial volume parameters and volume types, wherein the volume types comprise at least one of distributed volumes, duplicate volumes and erasure code volumes;
determining a volume attribute according to the volume type;
and determining a target volume parameter according to the initial volume parameter and the volume attribute.
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 replica volume include: volume name, volume capacity, number of copies and number of placement groups; the volume attributes of the erasure coded volume include: volume name, volume capacity, number of data blocks, and number of parity blocks.
4. The method of claim 1, wherein upon detecting a create instruction, determining a volume create result from the test case comprises:
Executing webpage test operation according to the first test case or the second test case call Webdriver;
after the test operation is finished, when a creation instruction is detected, executing volume creation to obtain a volume creation result.
5. The method of claim 4, wherein performing web page test operations based on the first test case or second test case call Webdriver comprises:
According to the test case, positioning the webpage element by adopting a path expression or an element selector, wherein the webpage element comprises: 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 cases;
and executing input or selection operation on the positioned page elements according to the parameters to be input.
6. The method of claim 1, wherein determining web page test results for each test case based on the volume creation results comprises:
matching the volume creation result with the 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 passing;
if the volume creation result is inconsistent with the expected result, determining that the webpage test result of the test case is failed.
7. A web page testing apparatus based on volume creation, comprising:
The system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring target volume parameters, volume types and volume creation modes, and the volume creation modes comprise: single creation or batch creation;
The generation module is used for generating a test case according to the target volume parameter, the volume type and the volume creation mode;
the creation result determining module is used for determining a volume creation result according to the test case and the volume creation mode when the creation instruction is detected;
the test result determining module is used for determining the webpage test result of each test case according to the volume creation result;
The generating module comprises:
The acquisition unit is used for acquiring the expected result of the target volume parameter;
The first generation unit is used for generating first test cases of different volume types according to normal values in target volume parameters and expected results of the target volume parameters if the volume creation mode is single creation; the normal value is a non-null value and does not contain special characters;
and the second generating unit is used for organizing the test cases by using a Pairwise algorithm to generate 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, wherein the at least two groups of second test cases are comprehensive test cases without redundancy.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1-6 when the program is executed by the processor.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110025551.3A CN112597058B (en) | 2021-01-08 | 2021-01-08 | Webpage testing method, device, equipment and storage medium based on volume creation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110025551.3A CN112597058B (en) | 2021-01-08 | 2021-01-08 | Webpage testing method, device, equipment and storage medium based on volume creation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112597058A CN112597058A (en) | 2021-04-02 |
CN112597058B true CN112597058B (en) | 2024-07-26 |
Family
ID=75207302
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110025551.3A Active CN112597058B (en) | 2021-01-08 | 2021-01-08 | Webpage testing method, device, equipment and storage medium based on volume creation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112597058B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Family Cites Families (4)
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 |
US10140204B2 (en) * | 2015-06-08 | 2018-11-27 | International Business Machines Corporation | Automated dynamic test case generation |
CN107704392B (en) * | 2017-09-30 | 2021-05-18 | 华为技术有限公司 | Test case processing method and server |
CN112162927B (en) * | 2020-10-13 | 2024-04-26 | 网易(杭州)网络有限公司 | Testing method, medium, device and computing equipment of cloud computing platform |
-
2021
- 2021-01-08 CN CN202110025551.3A patent/CN112597058B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Also Published As
Publication number | Publication date |
---|---|
CN112597058A (en) | 2021-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108519967B (en) | Chart visualization method and device, terminal and storage medium | |
CN107506300B (en) | User interface testing method, device, server and storage medium | |
US9274782B2 (en) | Automated computer application update analysis | |
CN111930489B (en) | Task scheduling method, device, equipment and storage medium | |
CN109558525B (en) | Test data set generation method, device, equipment and storage medium | |
CN110990411B (en) | Data structure generation method and device, and calling method and device | |
JP2019169126A (en) | Artificial intelligence-based triple checking method, device, and computer program | |
CN111813804A (en) | Data query method and device, electronic equipment and storage medium | |
CN110941547B (en) | Automatic test case library management method, device, medium and electronic equipment | |
CN109951553B (en) | Data processing method, system, electronic device and computer readable storage medium | |
CN114416667A (en) | Method and device for rapidly sharing network disk file, network disk 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 | |
CN113836014A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN113094625A (en) | Page element positioning method and device, electronic equipment and storage medium | |
CN112162976A (en) | Data reconciliation method, device, equipment and storage medium | |
CN111694684A (en) | Abnormal construction method and device of storage equipment, electronic equipment and storage medium | |
CN115408358B (en) | Network disk online file management method and device, network disk and storage medium | |
CN112597058B (en) | Webpage testing method, device, equipment and storage medium based on volume creation | |
CN115130130B (en) | Network disk file unlocking method and device, network disk and storage medium | |
CN110958243A (en) | Network vulnerability submitting method and device, storage medium and electronic equipment | |
CN115022201B (en) | Data processing function test method, device, equipment and storage medium | |
CN114780497B (en) | Batch file processing method, apparatus, computer device, medium, and program product | |
CN115328891A (en) | Data migration method and device, storage medium and electronic equipment | |
CN116263640A (en) | Efficient storage method and device for medical images |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |