Dynamic form test script generation method and device, equipment and storage medium
By parsing dynamic form page configuration files and using public method libraries to generate test scripts, the problem of frequently re-acquisitioning page elements and writing test scripts in existing automated testing technologies is solved, improving testing efficiency and reducing costs.
Patent Information
- Application Number
- CN202311482346.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-08
- Publication Date
- 2025-05-13
AI Technical Summary
When handling dynamic form pages, existing automated testing technologies require frequent re-acquisition of page elements and writing test scripts, resulting in high testing costs and inefficiency.
By obtaining the page configuration file of the dynamic form page, using the public method library to parse and process it, a test script for the dynamic form page is generated, and the number of times the test script is written manually is reduced.
It improves the efficiency of testing work, reduces the time and labor cost of automated testing, and realizes rapid testing of dynamic form pages.
Smart Images

Figure CN119988207A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and in particular to a method, device, equipment and storage medium for generating a test script for a dynamic form. Background Art
[0002] At present, technologies related to dynamic forms and automated testing have been widely used. Dynamic forms are customized configurations for form pages, which stipulate that the form contains the required fields, control types, and restrictions, etc., and realize the generation and deployment of form pages through configuration, reducing the cost of page development. Automated testing is based on automated testing tools. By identifying spatial elements on the page and using code to simulate manual testing operations, it can perform functional testing of the page, reduce the manpower input of testing, and improve work efficiency.
[0003] After the system introduces dynamic form technology, if you want to add a new form page, you can configure and generate the relevant pages through user-defined configuration, without coding to change the page content, which greatly saves the time and manpower cost of system development. However, the configured pages still need to be tested by testers before they can be officially put into production environment for use. In the field of testing, the testing method generally adopted is manual testing by testers, or writing automated scripts for automated testing. The cost of manual testing is high. If you want to reduce the manpower and time investment in testing, you will generally adopt the method of automated testing.
[0004] The current automated testing technology still follows the following steps in its implementation: page object element identification and acquisition; automated testing common method development; test script writing; test script execution. Among them, only the second step has a certain degree of reusability. For different pages, page objects need to be re-acquired, and test scripts need to be written according to the different business logic of the page and the different restrictions of the controls (the first and third steps), resulting in a high implementation cost for automated testing itself. Once a new page is tested, it is necessary to re-acquire page elements and rewrite test scripts. Even if there are minor changes to the original page, the test script of the entire page needs to be rewritten and debugged, making the cost of automated testing still high and failing to achieve the expected results. Summary of the invention
[0005] The present application provides a test script generation method, device, equipment and storage medium for a dynamic form, which are used to solve the problems of high time cost and labor cost of automated testing.
[0006] On the one hand, the present application provides a method for generating a test script for a dynamic form, the method comprising:
[0007] Acquire a page configuration file of a dynamic form page, wherein the page configuration file is used to indicate page information of the dynamic form page;
[0008] Parsing the page configuration file according to the public method library to obtain key information corresponding to the dynamic form page;
[0009] A test script for the dynamic form page is generated according to the key information and the public test methods pre-stored in the public method library.
[0010] Optionally, the key information includes: the ID and type of the dynamic form page, and the type restriction rules corresponding to each type, and generating the test script of the dynamic form page according to the key information and the public test method pre-stored in the public method library includes:
[0011] Using the ID and the type as parameters to call a page element identification method in the public method library to determine at least one target page element corresponding to the dynamic form page;
[0012] Determine the business logic restriction rule of each target page element according to the at least one target page element and the type restriction rule corresponding to each type;
[0013] A test script for the dynamic form page is generated according to the business logic restriction rules of each target page element and a plurality of test script parameters pre-stored in the public method library.
[0014] Optionally, generating the test script of the dynamic form page according to the business logic restriction rules of each target page element and a plurality of test script parameters pre-stored in the common method library includes:
[0015] Determine a target script test parameter corresponding to each target page element according to a business logic restriction rule of at least one target page element and a plurality of test script parameters;
[0016] The at least one target script test parameter is combined and processed to obtain a test script for the dynamic form page.
[0017] Optionally, before obtaining the page configuration file of the dynamic form page, the method further includes:
[0018] Obtain multiple page element recognition methods, multiple types of corresponding page element testing methods, multiple test script parameters, and multiple configuration file parsing methods;
[0019] The multiple page element identification methods, multiple types of corresponding page element testing methods, multiple test script parameters and multiple configuration file parsing methods are encapsulated into the public method library, so that the public method library generates corresponding test scripts according to the page configuration file.
[0020] On the other hand, the present application provides a test script generation device for a dynamic form, comprising:
[0021] An acquisition module, used for acquiring a page configuration file of a dynamic form page, wherein the page configuration file is used for indicating page information of the dynamic form page;
[0022] A parsing module, used for parsing the page configuration file according to a public method library to obtain key information corresponding to the dynamic form page;
[0023] A generating module is used to generate a test script for the dynamic form page according to the key information and the common test methods pre-stored in the common method library.
[0024] Optionally, the device further comprises: a calling module and a determining module;
[0025] A calling module, used for calling a page element identification method in the public method library by taking the ID and the type as parameters to determine at least one target page element corresponding to the dynamic form page;
[0026] A determination module, configured to determine a business logic restriction rule for each target page element according to the at least one target page element and a type restriction rule corresponding to each type;
[0027] The generating module is further used to generate the test script of the dynamic form page according to the business logic restriction rules of each target page element and a plurality of test script parameters pre-stored in the public method library.
[0028] Optionally, the device further comprises: a processing module;
[0029] A determination module, used to determine a target script test parameter corresponding to each target page element according to a business logic restriction rule of at least one target page element and a plurality of test script parameters;
[0030] The processing module is used to perform combination processing on the at least one target script test parameter to obtain the test script of the dynamic form page.
[0031] Optionally, the device further comprises: a packaging module;
[0032] An acquisition module is used to acquire multiple page element recognition methods, multiple types of corresponding page element test methods, multiple test script parameters and multiple configuration file parsing methods;
[0033] The encapsulation module is used to encapsulate the multiple page element identification methods, multiple types of corresponding page element test methods, multiple test script parameters and multiple configuration file parsing methods into the public method library, so that the public method library generates corresponding test scripts according to the page configuration file.
[0034] In a third aspect, the present application provides a test script generation device for a dynamic form, the device comprising:
[0035] Memory;
[0036] processor;
[0037] Wherein, the memory stores computer-executable instructions;
[0038] The processor executes the computer-executable instructions stored in the memory to implement the test script generation method for the dynamic form as described in the first aspect and various possible implementations of the first aspect.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method for generating a test script for a dynamic form as described in the first aspect and various possible implementations of the first aspect.
[0040] The present application provides a method, device, equipment and storage medium for generating a test script for a dynamic form, by obtaining a page configuration file of a dynamic form page, where the page configuration file is used to indicate the page information of the dynamic form page. The page configuration file is parsed and processed according to a public method library to obtain key information corresponding to the dynamic form page. A test script for the dynamic form page is generated based on the key information and the public test methods pre-stored in the public method library. The method combines dynamic forms with automated testing technology, utilizes the characteristic that a dynamic form page will output a page attribute configuration file during the configuration process, parses the page attribute configuration file, and calls a public method to automatically generate a test script, thereby improving the efficiency of the testing work and reducing the time and labor costs of automated testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] Figure 1 Schematic diagram of the process of generating a test script for a dynamic form provided in this application Figure 1 ;
[0043] Figure 2 Schematic diagram of the process of generating a test script for a dynamic form provided in this application Figure 2 ;
[0044] Figure 3 A schematic diagram of the structure of a test script generating device for a dynamic form provided in this application;
[0045] Figure 4 A schematic diagram of the structure of a test script generation device for a dynamic form provided in this application.
[0046] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0047] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims, rather than all embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0048] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, products or devices.
[0049] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0050] At present, technologies related to dynamic forms and automated testing have been widely used. Dynamic forms are customized configurations for form pages, which stipulate that the form contains the required fields, control types, and restrictions, etc., and realize the generation and deployment of form pages through configuration, reducing the cost of page development. Automated testing is based on automated testing tools. By identifying spatial elements on the page and using code to simulate manual testing operations, it can perform functional testing of the page, reduce the manpower input of testing, and improve work efficiency.
[0051] After the system introduces dynamic form technology, if you want to add a new form page, you can configure and generate the relevant pages through user-defined configuration, without coding to change the page content, which greatly saves the time and manpower cost of system development. However, the configured pages still need to be tested by testers before they can be officially put into production environment for use. In the field of testing, the testing method generally adopted is manual testing by testers, or writing automated scripts for automated testing. The cost of manual testing is high. If you want to reduce the manpower and time investment in testing, you will generally adopt the method of automated testing.
[0052] The current automated testing technology still follows the following steps in its implementation: page object element identification and acquisition; automated testing common method development; test script writing; test script execution. Among them, only the second step has a certain degree of reusability. For different pages, page objects need to be re-acquired, and test scripts need to be written according to the different business logic of the page and the different restrictions of the controls (the first and third steps), resulting in a high implementation cost for automated testing itself. Once a new page is tested, it is necessary to re-acquire page elements and rewrite test scripts. Even if there are minor changes to the original page, the test script of the entire page needs to be rewritten and debugged, making the cost of automated testing still high and failing to achieve the expected results.
[0053] In response to the above problems, the present application proposes a test script generation method for dynamic forms. The method optimizes automated testing based on dynamic form technology, utilizes the characteristic that dynamic form pages will output page attribute configuration files during the configuration process, reduces the number of times page configuration file elements are obtained by writing test scripts, and directly calls public methods to automatically generate test scripts, thereby improving the efficiency of testing work and reducing the time and labor costs of automated testing.
[0054] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0055] Figure 1 A flow chart of a method for generating a test script for a dynamic form provided in an embodiment of the present application Figure 1 .like Figure 1 As shown, the method includes:
[0056] S101: Acquire a page configuration file of a dynamic form page, where the page configuration file is used to indicate page information of the dynamic form page.
[0057] As you can understand, dynamic forms can be customized. After negotiating with developers to determine the configuration rules, test users can customize dynamic forms. After completing the form page configuration, the dynamic form will automatically output a page configuration file in json format. The page configuration file contains the information of all pages of the dynamic form page. For example, the page information can include form labels, form buttons, form fields, etc.
[0058] S102: parsing the page configuration file according to the public method library to obtain key information corresponding to the dynamic form page.
[0059] Among them, the public method library is a collection of all test parameters created in advance by the tester.
[0060] It can be understood that the page configuration file generated by the dynamic form page is input into the public method library, and the public method library contains the parsing method of the page configuration file. The parsing method in the public method library parses the page configuration file to obtain the key information in the page configuration file. The key information refers to the key information specifically input when configuring the dynamic form. For example, the key information can be the ID, type, and restriction rules of the page element.
[0061] S103: Generate a test script for the dynamic form page according to the key information and the public test methods pre-stored in the public method library.
[0062] It can be understood that after parsing the page configuration file, the key information indicated by the page configuration file is obtained, and the corresponding test method is selected using the key information obtained, and then the test script of the dynamic form page can be generated by combining the public methods required for the test. For example, the public methods include the test generation method and the test report generation method. The public methods stored in the public method library can be called repeatedly, so it is only necessary to create a public method library once, which reduces the number of times the test script is written and reduces the manpower and time cost of the test.
[0063] The test script generation method for a dynamic form provided in this embodiment obtains a page configuration file of a dynamic form page, and the page configuration file is used to indicate the page information of the dynamic form page. The page configuration file is parsed and processed according to a public method library to obtain key information corresponding to the dynamic form page. A test script for the dynamic form page is generated according to the key information and the public test method pre-stored in the public method library. The method combines dynamic forms with automated testing technology, utilizes the characteristic that a dynamic form page will output a page attribute configuration file during the configuration process, parses the page attribute configuration file, and calls a public method to automatically generate a test script, thereby improving the efficiency of the test work and reducing the time and labor costs of automated testing.
[0064] Figure 2 A flow chart of a method for generating a test script for a dynamic form provided in an embodiment of the present application Figure 2 The key information in this embodiment includes: the ID and type of the dynamic form page, and the type restriction rules corresponding to each type. Figure 1 Based on the embodiment, a detailed description of the test script generation process of the dynamic form page is provided. Figure 2 As shown, this embodiment provides a personalized billing method, including:
[0065] S201: Acquire a page configuration file of a dynamic form page, where the page configuration file is used to indicate page information of the dynamic form page.
[0066] Among them, step S101 is similar to step S201 and will not be repeated here.
[0067] S202: parsing the page configuration file according to the public method library to obtain key information corresponding to the dynamic form page.
[0068] Among them, step S102 and step S202 are similar and will not be repeated here.
[0069] S203: calling a page element identification method in the public method library with the ID and the type as parameters to determine at least one target page element corresponding to the dynamic form page.
[0070] Among them, ID and type refer to the key information contained in the dynamic form page.
[0071] It can be understood that after parsing the page configuration file, the IDs and types of multiple page elements of the dynamic form page are obtained, and the page element identification method is called with the page element ID and type as parameters to identify and locate the page element and determine the location of multiple page elements in the dynamic form page. The location of multiple page elements and the specific type of the page element are also target page elements, and at least one target page element also indicates that there is at least one page element to be tested in the dynamic form.
[0072] S204: Determine the business logic restriction rule of each target page element according to the at least one target page element and the type restriction rule corresponding to each type.
[0073] Among them, type restriction rules refer to the set rules for each page element. For example, the input box of the dynamic form has a fixed length limit, the input types of the input box include text, image, audio, etc., and special characters are not allowed in the input box. Business logic restriction rules refer to the restriction rules of the target page elements of the dynamic form page to be tested. For example, the input box in the dynamic form page can only input Chinese characters. The first button in the dynamic form is to register, and the second button is to log in, etc.
[0074] It can be understood that the location of the target page element and the type of the page element are determined through the page element identification method in the public method library. Each target page element is located, and then the business logic restriction rules of each page element are determined according to the type of the target page element corresponding to its type restriction rule. For example, the dynamic form page to be tested contains a text box. The location of the text box is on the fifth line of the dynamic form page. The type restriction rule of the text box type includes the length of the text box. The length of the text box of the dynamic form page is 20 words. The length of the text box is 20 words, which is the business logic restriction rule of the target page element, the text box.
[0075] S205: Determine a target script test parameter corresponding to each target page element according to a business logic restriction rule of at least one target page element and a plurality of test script parameters.
[0076] The multiple test script parameters refer to multiple test methods created in the public method library.
[0077] It can be understood that the page configuration file is parsed to obtain all target page elements on the dynamic form page, and the test method of the target page element is obtained in the public method library according to the target page element. For example, the test method includes: a method for checking the input type of the input box, a method for checking the input length limit, a method for checking the preset options of the drop-down bar, a method for checking whether multiple selections are supported, a method for checking whether the page metadata is required, a method for checking the page display after the form is submitted, etc. These methods are combined with the business logic restriction rules of the target page elements to determine the target script test parameters corresponding to each target page element. For example, the target script test parameters can be to check whether the type in the input box of the dynamic form page is text, whether the input length of the input box exceeds 20 characters, etc.
[0078] S206: Combining and processing the at least one target script test parameter to obtain a test script for the dynamic form page.
[0079] It can be understood that after obtaining the target script test parameters of all target page elements in the dynamic form page, it is combined with other necessary public test methods in the automated test process to generate the test scripts of all target page elements of the dynamic form page and the test results of the target page elements. For example, other necessary public test methods include test initialization method and test report generation method.
[0080] For example, after completing the configuration of the dynamic form, a page configuration file containing the following page element information is obtained.
[0081] The page configuration file content is as follows:
[0082] {
[0083] "id":"00001";
[0084] "class":"el-input";
[0085] "input type":"text";
[0086] "maxlength":"200";
[0087] "placeholder":"Please enter information";
[0088] }
[0089] The public method library obtains this page configuration file and parses it. The id information can be used to identify and locate the page element. According to the class, it is known that this page element is an input box, the input type is limited to text, the maximum length is 200, and the prompt text of the input box is "Please enter information". After parsing this information, the input type check method, input length limit check method, test initialization method, test report generation method, etc. of the input box can be obtained from the public method library. Combined with the input type limit of text and the maximum length of 200, a test script is formed to generate a test report and complete the test of the dynamic form.
[0090] Optionally, before obtaining the page configuration file of the dynamic form page, the method further includes:
[0091] Obtain multiple page element recognition methods, multiple types of corresponding page element testing methods, multiple test script parameters and multiple configuration file parsing methods.
[0092] The multiple page element identification methods, multiple types of corresponding page element testing methods, multiple test script parameters and multiple configuration file parsing methods are encapsulated into the public method library, so that the public method library generates corresponding test scripts according to the page configuration file.
[0093] Among them, parts of the page element test methods corresponding to the various types are the target page element test script parameters.
[0094] It is understandable that before obtaining the page configuration file of the dynamic form page, a public method library must be created first. The public method library is the basis for automatically generating automated test scripts later.
[0095] The contents of the public method library mainly include four categories:
[0096] The first category is multiple page element identification methods, which are mainly used to identify and locate page elements so that subsequent test scripts can perform relevant operations and checks on these page elements;
[0097] The second category is page element testing methods corresponding to various types. This type of method is mainly used to test page elements of dynamic form pages. For example, this type of method includes: input type checking method of input box, input length limit checking method, preset option checking method of drop-down bar, whether multiple selection is supported, whether page metadata is required, and page display checking method after form submission.
[0098] The third category is multiple test script parameters. This type of method mainly refers to the common methods in the automated testing process, that is, methods that exist in all testing processes and do not need to be obtained through page elements. Examples include test initialization methods, test report generation methods, etc.
[0099] The fourth category is multiple configuration file parsing methods. This type of method is mainly used to analyze page configuration files, obtain key information of page elements and parameterize them, and select test methods and generate scripts based on the key information of page elements.
[0100] It can be understood that after obtaining the above four types of methods, the running scripts of all methods are encapsulated and saved in the public method library, so that they can be called and combined to generate test scripts in subsequent testing processes, reducing the number of times test script codes are written and improving testing efficiency.
[0101] Optionally, through the above method, after the page of the dynamic form is changed, it is only necessary to parse the page configuration file again to automatically generate the test script again.
[0102] It is understandable that in traditional technology, once the information on the form page changes, it is necessary to manually write a code script to re-acquire the page information of the form. Even if there are only minor changes in the information in the form, the information of the entire page must be re-acquired, and then the test script must be rewritten based on the different page elements, different business logics, and restrictions of different controls in the page. This application is based on the characteristics that the dynamic form will output the page attribute configuration file during the configuration process. After the dynamic form page is changed, it only needs to input the new configuration file into the public method library. The public method library parses the page configuration file, and according to the key information of the page configuration file obtained, the page test script parameters of the changed information are retrieved, and combined with other test script parameters to generate a new test script.
[0103] The test script generation method for a dynamic form provided in this embodiment obtains the page configuration file of the dynamic form page, parses the page configuration file according to the public method library, and obtains the key information corresponding to the dynamic form page. The page element identification method in the public method library is called with the ID and type as parameters to determine at least one target page element corresponding to the dynamic form page. According to the at least one target page element and the type restriction rules corresponding to each type, the business logic restriction rules of each target page element are determined. According to the business logic restriction rules of at least one target page element and multiple test script parameters, the target script test parameters corresponding to each target page element are determined. At least one target script test parameter is combined to obtain the test script of the dynamic form page. The method inputs the page configuration file into the public method library for parsing, obtains the key information of the page configuration file, and then retrieves the test parameters according to the key information to generate a test script, thereby improving the efficiency of automated testing and reducing the implementation cost of automated testing.
[0104] Figure 3 This is a schematic diagram of the structure of the test script generation device for the dynamic form provided by this application. Figure 3 As shown, the test script generating device 300 of the dynamic form provided by the present application includes:
[0105] An acquisition module 301 is used to acquire a page configuration file of a dynamic form page, where the page configuration file is used to indicate page information of the dynamic form page;
[0106] The parsing module 302 is used to parse the page configuration file according to the public method library to obtain key information corresponding to the dynamic form page;
[0107] The generating module 303 is used to generate a test script for the dynamic form page according to the key information and the common test methods pre-stored in the common method library.
[0108] Optionally, the device further includes: a calling module 304, a determining module 305;
[0109] A calling module 304 is used to call a page element identification method in the public method library by taking the ID and the type as parameters to determine at least one target page element corresponding to the dynamic form page;
[0110] A determination module 305, configured to determine a business logic restriction rule for each target page element according to the at least one target page element and the type restriction rule corresponding to each type;
[0111] The generating module 303 is further used to generate a test script for the dynamic form page according to the business logic restriction rules of each target page element and a plurality of test script parameters pre-stored in the common method library.
[0112] Optionally, the device further includes: a processing module 306;
[0113] A determination module 305, configured to determine a target script test parameter corresponding to each target page element according to a business logic restriction rule of at least one target page element and a plurality of test script parameters;
[0114] The processing module 306 is used to perform combination processing on the at least one target script test parameter to obtain the test script of the dynamic form page.
[0115] Optionally, the device further includes: a packaging module 307;
[0116] An acquisition module 301 is used to acquire multiple page element recognition methods, multiple types of corresponding page element test methods, multiple test script parameters and multiple configuration file parsing methods;
[0117] The encapsulation module 307 is used to encapsulate the multiple page element identification methods, multiple types of corresponding page element test methods, multiple test script parameters and multiple configuration file parsing methods into the public method library, so that the public method library generates corresponding test scripts according to the page configuration file.
[0118] Figure 4 This is a schematic diagram of the structure of the test script generation device for the dynamic form provided in this application. Figure 4 As shown, the present application provides a test script generation device for a dynamic form, and the test script generation device 400 for a dynamic form includes: a receiver 401 , a transmitter 402 , a processor 403 and a memory 404 .
[0119] Receiver 401, used for receiving instructions and data;
[0120] A transmitter 402, used for sending instructions and data;
[0121] Memory 404, for storing computer-executable instructions;
[0122] The processor 403 is used to execute the computer-executable instructions stored in the memory 404 to implement the various steps executed by the personalized billing method in the above embodiment. For details, please refer to the relevant description in the above embodiment of the personalized billing method.
[0123] Optionally, the memory 404 may be independent or integrated with the processor 403 .
[0124] When the memory 404 is independently provided, the electronic device further includes a bus for connecting the memory 404 and the processor 403 .
[0125] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, a personalized billing method executed by the above-mentioned personalized billing device is implemented.
[0126] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0127] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0128] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for generating a test script for a dynamic form, characterized in that: include: Acquire a page configuration file of a dynamic form page, wherein the page configuration file is used to indicate page information of the dynamic form page; Parsing the page configuration file according to the public method library to obtain key information corresponding to the dynamic form page; A test script for the dynamic form page is generated according to the key information and the public test methods pre-stored in the public method library.
2. The method according to claim 1, characterized in that The key information includes: the ID and type of the dynamic form page, and the type restriction rules corresponding to each type. The test script of the dynamic form page is generated according to the key information and the public test method pre-stored in the public method library, including: Using the ID and the type as parameters to call a page element identification method in the public method library to determine at least one target page element corresponding to the dynamic form page; Determine the business logic restriction rule of each target page element according to the at least one target page element and the type restriction rule corresponding to each type; A test script for the dynamic form page is generated according to the business logic restriction rules of each target page element and a plurality of test script parameters pre-stored in the public method library.
3. The method according to claim 2, characterized in that The step of generating a test script for the dynamic form page according to the business logic restriction rules of each target page element and a plurality of test script parameters pre-stored in the common method library comprises: Determine a target script test parameter corresponding to each target page element according to a business logic restriction rule of at least one target page element and a plurality of test script parameters; The at least one target script test parameter is combined and processed to obtain a test script for the dynamic form page.
4. The method according to claim 1, characterized in that: Before obtaining the page configuration file of the dynamic form page, the method further includes: Obtain multiple page element recognition methods, multiple types of corresponding page element testing methods, multiple test script parameters, and multiple configuration file parsing methods; The multiple page element identification methods, multiple types of corresponding page element testing methods, multiple test script parameters and multiple configuration file parsing methods are encapsulated into the public method library, so that the public method library generates corresponding test scripts according to the page configuration file.
5. A test script generating device for a dynamic form, characterized in that: The device comprises: An acquisition module, used for acquiring a page configuration file of a dynamic form page, wherein the page configuration file is used for indicating page information of the dynamic form page; A parsing module, used for parsing the page configuration file according to a public method library to obtain key information corresponding to the dynamic form page; A generating module is used to generate a test script for the dynamic form page according to the key information and the common test methods pre-stored in the common method library.
6. The device according to claim 5, characterized in that The device also includes: a calling module and a determining module; A calling module, configured to call a page element identification method in the public method library by taking the ID of the dynamic form page and the type of the dynamic form page as parameters, and determine at least one target page element corresponding to the dynamic form page; A determination module, configured to determine a business logic restriction rule for each target page element according to the at least one target page element and a type restriction rule corresponding to each type; The generating module is further used to generate the test script of the dynamic form page according to the business logic restriction rules of each target page element and a plurality of test script parameters pre-stored in the public method library.
7. The device according to claim 5, characterized in that The device further comprises: a processing module; A determination module, used to determine a target script test parameter corresponding to each target page element according to a business logic restriction rule of at least one target page element and a plurality of test script parameters; The processing module is used to perform combination processing on the at least one target script test parameter to obtain the test script of the dynamic form page.
8. The device according to claim 5, characterized in that The device further comprises: a packaging module; An acquisition module, used to acquire multiple page element recognition methods, multiple types of corresponding page element test methods, multiple test script parameters and multiple configuration file parsing methods; The encapsulation module is used to encapsulate the multiple page element identification methods, multiple types of corresponding page element test methods, multiple test script parameters and multiple configuration file parsing methods into the public method library, so that the public method library generates corresponding test scripts according to the page configuration file.
9. A test script generating device for a dynamic form, characterized in that: include: Memory; processor; Wherein, the memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the test script generation method for a dynamic form according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the test script generation method for a dynamic form according to any one of claims 1 to 4.