CN112612563A - Page test data generation method and device and computer equipment - Google Patents

Page test data generation method and device and computer equipment Download PDF

Info

Publication number
CN112612563A
CN112612563A CN202011488065.7A CN202011488065A CN112612563A CN 112612563 A CN112612563 A CN 112612563A CN 202011488065 A CN202011488065 A CN 202011488065A CN 112612563 A CN112612563 A CN 112612563A
Authority
CN
China
Prior art keywords
data
page
attribute value
test
initial
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
CN202011488065.7A
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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202011488065.7A priority Critical patent/CN112612563A/en
Publication of CN112612563A publication Critical patent/CN112612563A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a page test data generation method, a page test data generation device and computer equipment, wherein the method comprises the following steps: acquiring initial page data of a page to be tested, and identifying each data body and a corresponding attribute value in the initial page data; changing the attribute value of a target data body in the initial page data according to a preset change rule to obtain changed page data, wherein the target data body is any data body in the initial page data; and storing the changed page data as page test data. The present application also provides a computer-readable storage medium. According to the method and the device, the attribute value of the data body in the original page data is changed, and changed page data containing different boundary values, namely page test data, is obtained, so that the coverage and the test efficiency of page tests are improved.

Description

Page test data generation method and device and computer equipment
Technical Field
The present application relates to the field of automated testing technologies, and in particular, to a method and an apparatus for generating page test data, and a computer device.
Background
Generally, a user can access various data resources through a web page or an APP (Application) page, wherein the web page or the APP page needs not only to show the data resources but also to provide an interactive function for the user. Therefore, after each webpage or APP page is designed, various page tests are required, so that the webpage or the APP page can be normally displayed, and abnormal conditions such as breakdown and the like can be avoided in the user interaction process.
For testing a webpage or an APP page, sometimes a tester needs to set various boundary values for page data of one page, and then test whether the page is abnormal or not. However, the setting of the page boundary values by manual execution is time-consuming and labor-consuming, and the testing efficiency is low.
Disclosure of Invention
The application provides a method and a device for generating page test data and computer equipment, which can solve the problems of time and labor consumption and low efficiency in the generation of the page test data in the page test process in the prior art.
First, to achieve the above object, the present application provides a method for generating page test data, where the method includes:
acquiring initial page data of a page to be tested; identifying each data body and corresponding attribute value in the initial page data; changing the attribute value of a target data body in the initial page data according to a preset change rule to obtain changed page data, wherein the target data body is any data body in the initial page data; and storing the changed page data as page test data.
In one example, the identifying each data body and the corresponding attribute value in the initial page data includes: scanning each row of data in the initial page data; and identifying the data body and the corresponding attribute value included in each row of data according to a preset field format of the data body.
In one example, the change rule includes: deleting the initial attribute value of the target data volume, and then setting the attribute value of the target data volume to zero, null or a preset boundary value.
In one example, the data volume includes a data object type data volume, an array type data volume, or a general type data volume.
In one example, when the target data volume is an object-type data volume or an array-type data volume and a normal-type data volume is nested, the modifying the attribute value of the target data volume includes: and executing attribute value change on the object type data body according to a change rule used for executing change of attribute values of the object type data body and the normal type data body in the change rule, and executing attribute value change on the normal type data body according to a change rule used for executing change of attribute values of the normal type data body in the change rule.
In one example, the modifying the attribute value of the target data volume in the initial page data according to a preset modification rule to obtain modified page data includes: and after each attribute value change, storing all data bodies and corresponding attribute values in the initial page data as a piece of changed page data.
In one example, the method further comprises: rendering the page to be tested according to the initial page data and each piece of changed page data respectively so as to be used for executing page testing; and before executing page test, marking corresponding identification codes on the initial page data and each piece of changed page data respectively.
In one example, when an error occurs in a test page rendered by initial page data or changed page data in a test process, a page data identification code corresponding to the test page is obtained and fed back to a user.
In addition, in order to achieve the above object, the present application further provides a page test data generating apparatus, including:
the acquisition module is used for acquiring initial page data of the page to be tested; the identification module is used for identifying each data body and the corresponding attribute value in the initial page data; the change module is used for changing the attribute value of a target data body in the initial page data according to a preset change rule to obtain changed page data, wherein the target data body is any data body in the initial page data; and the storage module is used for storing the changed page data as page test data.
Further, the present application also provides a computer device, which includes a memory and a processor, where the memory stores a computer program that can run on the processor, and the computer program, when executed by the processor, implements the steps of the page test data generation method as described above.
Further, to achieve the above object, the present application also provides a computer-readable storage medium storing a computer program, which is executable by at least one processor to cause the at least one processor to execute the steps of the page test data generation method as described above.
Compared with the prior art, the page test data generation method, the page test data generation device, the computer equipment and the computer readable storage medium provided by the application can acquire initial page data of a page to be tested, and identify each data body and corresponding attribute value in the initial page data; then, according to a preset change rule, changing the attribute value of a target data body in the initial page data to obtain changed page data, wherein the target data body is any data body in the initial page data; and storing the changed page data as page test data. By changing the attribute value of the data body in the original page data, changed page data containing different boundary values, namely page test data, is obtained, so that the coverage and the test efficiency of page tests are improved.
Drawings
FIG. 1 is a schematic diagram of an application environment according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for generating page test data according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating an effect of a process of changing attribute values of a target data volume in initial page data according to an exemplary embodiment of the present application;
FIG. 4 is a schematic diagram of program modules of an embodiment of the apparatus for generating page test data according to the present application;
FIG. 5 is a diagram of an alternative hardware architecture of the computer device of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the descriptions in this application referring to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
Fig. 1 is a schematic diagram of an application environment according to an embodiment of the present application. Referring to fig. 1, the computer apparatus 1 is connected to a data server. After receiving a test request for a page to be tested sent by a user side, the computer device 1 acquires initial page data of the page to be tested from the data server, and then identifies each data body and a corresponding attribute value in the initial page data; changing the attribute value of a target data body in the initial page data according to a preset change rule to obtain changed page data, wherein the target data body is any data body in the initial page data; and storing the changed page data as page test data, and finally executing the page test. In this embodiment, the computer device 1 may be a mobile phone, a tablet, a portable device, a PC, a test server, or the like; the data server can be used as a mobile phone, a tablet, a portable device, a PC (personal computer) or a server; the user side can be used as a research and development platform, a mobile phone, a tablet, a portable device or a PC.
Of course, in other embodiments, the computer device 1 may also directly store the initial page data of all pages, then call the initial page data of the page to be tested after receiving the test request of the page to be tested, generate changed page data corresponding to various boundary values of the page to be tested according to the change rule, and finally use the initial page data and all the changed page data to render the page to be tested for page testing.
Example one
Fig. 2 is a flowchart illustrating an embodiment of a method for generating page test data according to the present application. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description is made by way of example with the computer apparatus 1 as the execution subject.
As shown in FIG. 2, the page test data generation method may include steps S200 to S206.
Step S200, obtaining initial page data of the page to be tested.
Specifically, after receiving a test request for a page to be tested sent by a user side, the computer device 1 needs to generate the page to be tested. Therefore, the computer device 1 may request the data server for the data resource of the page to be tested according to the resource address of the page to be tested, where the data resource mainly includes initial page data of the page to be tested, and the page data of the webpage or the APP page may be directly rendered into a corresponding page container through an APP page browser or a rendering engine built in the webpage browser, so as to display the content on the page.
Step S202, identifying each data body and corresponding attribute value in the initial page data.
Specifically, after the initial page data of the page to be tested is obtained, the computer device 1 further identifies the initial page data, so as to obtain each data body and a corresponding attribute value in the initial page data. In this embodiment, since the page to be tested generally includes different page components, such as pictures, texts, animations, etc., the initial page data corresponding to the page to be tested also generally includes a plurality of different data bodies, which are different data objects, such as a data object type data body, an array type data body, or a common type data body, where the common type data body includes a character string, a number, or a boolean value. In an illustrative example, for example, most of the page data of APP pages or web pages are of the Json data type, and therefore, the page data corresponding to these pages generally includes data bodies such as Json objects, Json arrays, character strings, numbers or boolean values.
In this embodiment, the identifying, by the computer device 1, each data volume and corresponding attribute value in the initial page data includes: scanning each row of data in the initial page data; and identifying the data body and the corresponding attribute value included in each row of data according to a preset field format of the data body. Since each data body and corresponding attribute value in the page data are preset and have a certain format, the computer device 1 may compare each line of data in the initial page data with a field format corresponding to each preset data body, so as to identify each data body and corresponding attribute value in the initial page data.
Step S204, changing the attribute value of a target data body in the initial page data according to a preset change rule to obtain changed page data, wherein the target data body is any data body in the initial page data.
And step S206, storing the changed page data as page test data.
Specifically, after identifying each data body and the corresponding attribute value in the initial page data, the computer device 1 sequentially changes the attribute value of each data body in the initial page data according to a preset change rule. In this embodiment, the change rule includes: deleting the initial attribute value of the target data volume, and then setting the attribute value of the target data volume to zero, null or a preset boundary value. Of course, while the computer device 1 performs attribute value change on each data body in the initial page data, each time the attribute value is changed, the computer device 1 stores all the data bodies and the corresponding attribute values in the initial page data as a piece of changed page data. Wherein, the computer device 1 performs attribute value change on the target data volume in the initial page data according to a preset change rule to obtain changed page data, and the method includes: and after each attribute value change, storing all data bodies and corresponding attribute values in the initial page data as a piece of changed page data.
For example, after receiving the test request, the computer device 1 needs to open the page a to be tested through the APP or through the browser, so the computer device 1 may first obtain initial page data of the page a, such as Json1 data, from the server. The Json1 data can be parsed by the rendering engine and render the corresponding page view, so that the user can see the colorful pictures on the page A.
In this embodiment, the computer device 1 stores the Json1 data for rendering the page a in a local file as an original page data file. For example, the computer device 1 opens the Json1 data and scans the rows of data therein, for example, scans the first row, identifying that the first row includes a data body named "code" and the corresponding attribute value ". Then, the computer device 1 deletes the attribute value "of the" code "data body according to a preset change rule, that is, leaves the" code "data body empty; next, the computer device 1 saves all the data volumes and corresponding attribute values after the current change as a change page data file to the local, named JsonA 1.
Then, the computer device 1 continuously modifies the attribute value of the "code" data body to null according to a preset modification rule, that is, sets the "code" data body to null; next, the computer device 1 saves all the data volumes and corresponding attribute values after the current change as a change page data file to the local, named JsonA 2.
Then, the computer device 1 continuously modifies the attribute value "of the" code "data volume to a test according to a preset modification rule, where the test is a preset boundary value. That is, the computer device 1 sets the "code" data volume to a preset edit value; next, the computer device 1 saves all the data volumes and corresponding attribute values after the current change as a change page data file to the local, named JsonA 3.
In the above way, the computer device 1 enumerates all the attribute values of the "code" data volume. Then, the computer device 1 sequentially performs corresponding attribute value changes on other data volumes in the initial page data, for example, a "message" data volume and a "ttl" data volume, and each time the attribute value change is performed, all the data volumes and corresponding attribute values are saved locally as a changed page data file, and corresponding naming is performed, for example, jsonnan.
Finally, the computer device 1 changes the attribute value of the data volume according to an initial page data Json1 to obtain a Json file library including a plurality of Json ans as the page data for rendering the page a subsequently, thereby implementing the page test on the page a under any boundary value.
It is to be noted that, when the target data volume is an object type data volume or an array type data volume and a normal type data volume is nested, the computer device 1 performs attribute value modification on the target data volume, including: and executing attribute value change on the object type data body according to a change rule used for executing change of attribute values of the object type data body and the normal type data body in the change rule, and executing attribute value change on the normal type data body according to a change rule used for executing change of attribute values of the normal type data body in the change rule. When the object-type data volume or the array-type data volume is set as the boundary value, it is necessary to set a corresponding character string, numeral, or boolean value in the data volume, that is, it is necessary to change the attribute value of the normal data volume nested in the object-type data volume or the array-type data volume.
Finally, the computer device 1 renders the page to be tested according to the initial page data and each piece of the changed page data respectively for executing a page test.
Specifically, after the computer device 1 changes the attribute value of each data volume in the initial page data and obtains the corresponding changed page data, the computer device 1 renders the page to be tested according to the initial page data and each piece of the changed page data respectively for executing the page test.
Of course, in this embodiment, before performing the page test, the computer device 1 marks the corresponding identification codes on the initial page data and each piece of the changed page data, respectively. Therefore, in the process of executing the page test, when the initial page data or the test page rendered by changing the page data has an error in the test process, the computer device 1 may quickly acquire the identification code of the page data corresponding to the test page and feed the identification code back to the user. That is, in the above manner, the computer device 1 can quickly locate the corresponding page data and then find out the corresponding data volume and attribute value that cause the test problem.
By the method, the number of generated test files can be greatly reduced, and the possibility of page rendering collapse can be exhausted, so that the time for testing all the files is reduced, and the efficiency is improved; in addition, the generated test result data is clearer and easier to read, and the follow-up tracking problem is facilitated.
As shown in fig. 3, fig. 3 is a flowchart illustrating an effect of a process of changing an attribute value of a target data volume in initial page data according to an exemplary embodiment of the present application.
In this embodiment, the computer device 1 sequentially obtains each data volume from the initial page data through a recursive function, and then determines whether the data volume is an object-type data volume; when the computer device 1 judges that the data body is an object type data body, calling an attribute value change rule of the object type data body, and putting the attribute value change rule into an operation queue, wherein the operation queue realizes the change operation of the attribute values of different data bodies; meanwhile, traversing the object type data bodies, and finding out the ordinary type data bodies nested in the object type data bodies; and then, the common data body is transmitted into a recursion function, and the recursion judgment is carried out again. When the computer apparatus 1 determines that the data volume is not an object type data volume, it further determines whether the data volume is an array type data volume.
When the computer device 1 judges that the data body is an array type data body, calling an attribute value change rule of the array type data body, and putting the data body into an operation queue, wherein the operation queue realizes the change operation of the attribute values of different data bodies; meanwhile, traversing the array data bodies, and finding out the ordinary data bodies nested in the array data bodies; and then, the common data body is transmitted into a recursion function, and the recursion judgment is carried out again. When the computer apparatus 1 determines that the data body is not an array type data body, it further determines whether the data body is a normal type data body.
When the computer device 1 determines that the data body is a normal data body, the attribute value change rule of the normal data body is called and put into an operation queue, and the operation queue implements change operation on the attribute values of different data bodies. In the process that the operation queue performs change operation on the attribute values of different data volumes, after each attribute value change, the computer device 1 stores and numbers all the data volumes and the attribute values to be used as change page data for testing a page to be tested.
In summary, the page test data generation method provided in this embodiment can obtain initial page data of a page to be tested, and identify each data body and a corresponding attribute value in the initial page data; then, according to a preset change rule, changing the attribute value of a target data body in the initial page data to obtain changed page data, wherein the target data body is any data body in the initial page data; and storing the changed page data as page test data. The page test data is used for subsequently executing a page test. By changing the attribute value of the data body in the original page data, changed page data containing different boundary values, namely page test data, is obtained, so that the coverage and the test efficiency of page tests are improved.
Example two
Fig. 4 schematically shows a block diagram of a page test data generation apparatus according to a second embodiment of the present application, which may be divided into one or more program modules, the one or more program modules being stored in a storage medium and executed by one or more processors to implement the second embodiment of the present application. The program modules referred to in the embodiments of the present application refer to a series of computer program instruction segments that can perform specific functions, and the following description will specifically describe the functions of the program modules in the embodiments.
As shown in fig. 4, the page test data generating apparatus 400 may include an obtaining module 410, an identifying module 420, a changing module 430, and a saving module 440, wherein:
an obtaining module 410, configured to obtain initial page data of the page to be tested.
The identifying module 420 is configured to identify each data body and the corresponding attribute value in the initial page data.
And a changing module 430, configured to change an attribute value of a target data volume in the initial page data according to a preset changing rule, so as to obtain changed page data, where the target data volume is any data volume in the initial page data. The change rule includes: deleting the initial attribute value of the target data volume, and then setting the attribute value of the target data volume to zero, null or a preset boundary value.
A saving module 440, configured to store the changed page data as page test data.
In an exemplary embodiment, the identification module 420 is further configured to: scanning each row of data in the initial page data; and identifying the data body and the corresponding attribute value included in each row of data according to a preset field format of the data body. Wherein the data body comprises a data object type data body, an array type data body or a common type data body.
In an exemplary embodiment, when the target data volume is an object-type data volume or a group-type data volume and a normal data volume is nested, the modification module 430 is further configured to perform attribute value modification on the object-type data volume according to a modification rule for performing modification of an attribute value of the object-type data volume/modification of an attribute value of the object-type data volume in the modification rule, and further perform attribute value modification on the normal data volume according to a modification rule for performing modification of an attribute value of the normal data volume in the modification rule.
In an exemplary embodiment, the change module 430 is further configured to: and after each attribute value change, storing all data bodies and corresponding attribute values in the initial page data as a piece of changed page data.
In an exemplary embodiment, the saving module 440 is further configured to: and rendering the page to be tested according to the initial page data and each piece of changed page data respectively so as to execute page testing. Before executing page test, marking corresponding identification codes on the initial page data and each piece of the changed page data respectively. And when the initial page data or the test page rendered by the changed page data has errors in the test process, acquiring the page data identification code corresponding to the test page, and feeding back the page data identification code to the user.
EXAMPLE III
Fig. 5 schematically shows a hardware architecture diagram of a computer device 1 suitable for implementing the page test data generation method according to the third embodiment of the present application. In the present embodiment, the computer device 1 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a command set or stored in advance. For example, the server may be a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers) with a gateway function. As shown in fig. 5, the computer device 1 includes at least, but is not limited to: memory 510, processor 520, and network interface 530 may be communicatively linked to each other by a system bus. Wherein:
the memory 510 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 510 may be an internal storage module of the computer device 1, such as a hard disk or a memory of the computer device 1. In other embodiments, the memory 510 may also be an external storage device of the computer device 1, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 1. Of course, the memory 510 may also comprise both an internal memory module of the computer device 1 and an external memory device thereof. In this embodiment, the memory 510 is generally used for storing an operating system installed in the computer device 1 and various application software, such as program codes of a page test data generation method. In addition, the memory 510 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 520 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 520 is generally used for controlling the overall operation of the computer device 1, such as performing control and processing related to data interaction or communication with the computer device 1. In this embodiment, processor 520 is configured to execute program codes stored in memory 510 or process data.
Network interface 530 may include a wireless network interface or a wired network interface, and network interface 530 is typically used to establish communication links between computer device 1 and other computer devices. For example, the network interface 530 is used to connect the computer apparatus 1 with an external terminal through a network, establish a data transmission channel and a communication link between the computer apparatus 1 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), or Wi-Fi.
It should be noted that FIG. 5 only shows a computer device having components 510 and 530, but it should be understood that not all of the shown components are required and that more or fewer components may be implemented instead.
In this embodiment, the program code of the page test data generation method stored in the memory 510 may also be divided into one or more program modules and executed by one or more processors (in this embodiment, the processor 520) to implement the embodiments of the present application.
Example four
The present embodiments also provide a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the steps of:
acquiring initial page data of a page to be tested; identifying each data body and corresponding attribute value in the initial page data; changing the attribute value of a target data body in the initial page data according to a preset change rule to obtain changed page data, wherein the target data body is any data body in the initial page data; and storing the changed page data as page test data.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device. Of course, the computer-readable storage medium may also include both internal and external storage devices of the computer device. In this embodiment, the computer-readable storage medium is generally used for storing an operating system and various types of application software installed in the computer device, for example, the program code of the page test data generation method in the embodiment, and the like. Further, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different from that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications that can be made by the use of the equivalent structures or equivalent processes in the specification and drawings of the present application or that can be directly or indirectly applied to other related technologies are also included in the scope of the present application.

Claims (11)

1. A method for generating page test data is characterized by comprising the following steps:
acquiring initial page data of a page to be tested;
identifying each data body and corresponding attribute value in the initial page data;
changing the attribute value of a target data body in the initial page data according to a preset change rule to obtain changed page data, wherein the target data body is any data body in the initial page data;
and storing the changed page data as page test data.
2. The method for generating page test data according to claim 1, wherein said identifying each data body and corresponding attribute value in the initial page data comprises:
scanning each row of data in the initial page data;
and identifying the data body and the corresponding attribute value included in each row of data according to a preset field format of the data body.
3. The method for generating page test data according to claim 1, wherein the change rule includes:
deleting the initial attribute value of the target data volume, and then setting the attribute value of the target data volume to zero, null or a preset boundary value.
4. The method for generating page test data according to any one of claims 1 to 3, wherein the data body comprises a data object type data body, an array type data body or a normal type data body.
5. The page test data generating method according to claim 4, wherein when the target data body is an object type data body or an array type data body and a normal type data body is nested, the performing attribute value change on the target data body comprises:
and executing attribute value change on the object type data body according to a change rule used for executing change of attribute values of the object type data body and the normal type data body in the change rule, and executing attribute value change on the normal type data body according to a change rule used for executing change of attribute values of the normal type data body in the change rule.
6. The method for generating page test data according to claim 1, wherein the changing the attribute value of the target data body in the initial page data according to a preset change rule to obtain changed page data comprises: and after each attribute value change, storing all data bodies and corresponding attribute values in the initial page data as a piece of changed page data.
7. The method for generating page test data according to claim 6, said method further comprising:
rendering the page to be tested according to the initial page data and each piece of changed page data respectively so as to be used for executing page testing; and
before executing page test, marking corresponding identification codes on the initial page data and each piece of the changed page data respectively.
8. The method for generating page test data as claimed in claim 7, wherein when the test page rendered by the initial page data or the changed page data has an error in the test process, the identification code of the page data corresponding to the test page is obtained and fed back to the user.
9. An apparatus for generating page test data, the apparatus comprising:
the acquisition module is used for acquiring initial page data of the page to be tested;
the identification module is used for identifying each data body and the corresponding attribute value in the initial page data;
the change module is used for changing the attribute value of a target data body in the initial page data according to a preset change rule to obtain changed page data, wherein the target data body is any data body in the initial page data;
and the storage module is used for storing the changed page data as page test data.
10. A computer arrangement, characterized in that the computer arrangement comprises a memory, a processor, the memory having stored thereon a computer program being executable on the processor, the computer program, when being executed by the processor, realizing the steps of the page test data generation method according to any of the claims 1-8.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executable by at least one processor to cause the at least one processor to perform the steps of the page test data generation method according to any one of claims 1-8.
CN202011488065.7A 2020-12-16 2020-12-16 Page test data generation method and device and computer equipment Pending CN112612563A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011488065.7A CN112612563A (en) 2020-12-16 2020-12-16 Page test data generation method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011488065.7A CN112612563A (en) 2020-12-16 2020-12-16 Page test data generation method and device and computer equipment

Publications (1)

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

Family

ID=75240070

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011488065.7A Pending CN112612563A (en) 2020-12-16 2020-12-16 Page test data generation method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN112612563A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648945A (en) * 2016-09-30 2017-05-10 北京金山安全软件有限公司 Interface data testing method and device and electronic equipment
CN107678943A (en) * 2017-09-01 2018-02-09 千寻位置网络有限公司 The page automated testing method of abstract page object
CN108008936A (en) * 2017-12-04 2018-05-08 北京奇艺世纪科技有限公司 A kind of data processing method, device and electronic equipment
CN111538667A (en) * 2020-04-28 2020-08-14 北京三快在线科技有限公司 Page testing method and device
CN111639030A (en) * 2020-05-29 2020-09-08 深圳壹账通智能科技有限公司 Page testing method, device, equipment and storage medium
CN111797026A (en) * 2020-07-17 2020-10-20 上海复深蓝软件股份有限公司 Test case generation method and device, computer equipment and storage medium
CN112015635A (en) * 2019-05-31 2020-12-01 北京京东尚科信息技术有限公司 Page testing method, page testing device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648945A (en) * 2016-09-30 2017-05-10 北京金山安全软件有限公司 Interface data testing method and device and electronic equipment
CN107678943A (en) * 2017-09-01 2018-02-09 千寻位置网络有限公司 The page automated testing method of abstract page object
CN108008936A (en) * 2017-12-04 2018-05-08 北京奇艺世纪科技有限公司 A kind of data processing method, device and electronic equipment
CN112015635A (en) * 2019-05-31 2020-12-01 北京京东尚科信息技术有限公司 Page testing method, page testing device, electronic equipment and storage medium
CN111538667A (en) * 2020-04-28 2020-08-14 北京三快在线科技有限公司 Page testing method and device
CN111639030A (en) * 2020-05-29 2020-09-08 深圳壹账通智能科技有限公司 Page testing method, device, equipment and storage medium
CN111797026A (en) * 2020-07-17 2020-10-20 上海复深蓝软件股份有限公司 Test case generation method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107896162B (en) Deployment method and device of monitoring system, computer equipment and storage medium
CN110209652B (en) Data table migration method, device, computer equipment and storage medium
CN108388515B (en) Test data generation method, device, equipment and computer readable storage medium
CN108255701B (en) Scene testing method and mobile terminal
CN110928802A (en) Test method, device, equipment and storage medium based on automatic generation of case
CN113448862B (en) Software version testing method and device and computer equipment
CN109901881B (en) Plug-in loading method and device of application program, computer equipment and storage medium
CN113220657B (en) Data processing method and device and computer equipment
CN108776587B (en) Data acquisition method and device, computer equipment and storage medium
CN111444455A (en) Browser compatible method, system, computer device and storage medium
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN114546432A (en) Multi-application deployment method, device, equipment and readable storage medium
CN114442930A (en) Method and device for controlling group disk array, electronic equipment and readable storage medium
CN107766228B (en) Multi-language-based automatic testing method and device
CN112416648A (en) Data verification method and device
CN111913777A (en) Information processing method, information processing device, electronic equipment and storage medium
CN112612563A (en) Page test data generation method and device and computer equipment
CN115390847A (en) Log processing method and device, computer readable storage medium and terminal
CN115687146A (en) BIOS (basic input output System) test method and device, computer equipment and storage medium
CN115794690A (en) Processing method and device based on external equipment in server
CN114817152A (en) Method and system for querying slice file
CN112417324A (en) Chrome-based URL (Uniform resource locator) interception method and device and computer equipment
CN113934954A (en) Webpage first screen rendering method and device in application program
CN111563038A (en) SDK test method, device, computer equipment and computer readable storage medium
CN108509478B (en) Splitting and calling method of rule engine file, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210406