CN117609040A - Test page generation method, device, terminal equipment and storage medium - Google Patents

Test page generation method, device, terminal equipment and storage medium Download PDF

Info

Publication number
CN117609040A
CN117609040A CN202311614908.7A CN202311614908A CN117609040A CN 117609040 A CN117609040 A CN 117609040A CN 202311614908 A CN202311614908 A CN 202311614908A CN 117609040 A CN117609040 A CN 117609040A
Authority
CN
China
Prior art keywords
test
interface
generating
test page
modeling
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
CN202311614908.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.)
China Merchants Bank Co Ltd
Original Assignee
China Merchants Bank 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 China Merchants Bank Co Ltd filed Critical China Merchants Bank Co Ltd
Priority to CN202311614908.7A priority Critical patent/CN117609040A/en
Publication of CN117609040A publication Critical patent/CN117609040A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Abstract

The application discloses a test page generation method, a device, terminal equipment and a storage medium, wherein a modeling result is obtained through a pre-established model, and the model is constructed based on interface parameters and a decision table; parameter configuration is carried out on the modeling result; generating a first test case according to the modeling result after the parameter configuration; and generating a test page based on the modeling result after parameter configuration and the first test case. According to the scheme, modeling operation is carried out through a flow modeling platform according to parameters of the interface and the decision table, a test case is generated, and a corresponding test page is generated according to the test case, so that the cost of developing the test page is reduced, the preparation workload of testing is reduced, and the procedure of developing the test page is simplified.

Description

Test page generation method, device, terminal equipment and storage medium
Technical Field
The present invention relates to the field of automated testing, and in particular, to a method and apparatus for generating a test page, a terminal device, and a storage medium.
Background
With the continuous development of the internet, mobile clients are increasingly widely used. At present, the implementation of mobile client applications is mainly divided into Native development (App client) and page H5 development (front page), but due to different development modes, the page H5 cannot directly call Native development functions. In order to make the front end H5 page more convenient to use, app can package the Native function into an interface based on the method of JsBridge (JavaScript bridge) for the page H5 to use more conveniently. The client provides an interface, and the front-end page can conveniently use Native functions by calling an API interface packaged by the App when the page JavaScript is developed. As a client tester, it is necessary to test such APIs provided by mobile clients.
At present, the method for testing the interface mainly uses websocket (network socket) to connect the client side by the computer side, and temporarily fills in API call scripts to achieve the purpose of quick test, the method is more convenient to modify script parameters, but the used scripts are not stored, so that regression verification is inconvenient; the testers develop and deploy servers at the front end of H5 and set up portals in the App. The tester needs to write a simple test page to call the API to be tested, and stores the test page for regression verification. The method is convenient for testing and regression verification, but the development workload of the test page is large.
In summary, the existing test page mainly has the problems of large development workload and complex procedures.
Disclosure of Invention
The invention mainly aims to provide a test page generation method, a device, terminal equipment and a storage medium, and aims to solve the technical problems of large development workload of test pages and complex procedures.
In order to achieve the above object, the present application provides a test page generating method, including:
obtaining a modeling result through a pre-established model, wherein the model is constructed based on interface parameters and a decision table;
parameter configuration is carried out on the modeling result;
generating a first test case according to the modeling result after the parameter configuration;
and generating a test page based on the modeling result after parameter configuration and the first test case.
Optionally, the modeling result is obtained through a pre-established model, and before the step of constructing the model based on the interface parameters and the decision table, the method further comprises:
defining data input by an interface to obtain interface parameters;
acquiring parameter information related to an interface to be tested by inquiring a definition document of the interface to be tested;
and generating a decision table according to the parameter information related to the interface to be tested.
Optionally, the modeling result is obtained through a pre-established model, and the step of constructing the model based on the interface parameters and the decision table comprises the following steps:
generating an interface parameter template according to the decision table;
determining the relation between the interface parameters according to the interface parameter template;
determining a series path and a combined value between the interface parameters based on the relationship between the interface parameters;
and obtaining a modeling result according to the serial paths and the combined values among the interface parameters.
Optionally, the step of performing parameter configuration on the modeling result includes:
and carrying out parameter configuration on the modeling result to obtain a modeling result after parameter configuration, wherein the parameter configuration comprises environment preparation, code case generation and test page deployment middle stage.
Optionally, the step of generating the first test case according to the modeling result after the parameter configuration includes:
generating a first test case according to the modeling result after the parameter configuration;
naming, screening and sorting the first test cases to obtain a sorting result of the first test cases;
and generating a test page according to the sequencing result of the first test case.
Optionally, after the step of generating the test page based on the corresponding test case, the method further includes:
generating a script based on different interface types;
invoking the script to traverse the corresponding test case to obtain a corresponding script;
and testing the interface to be tested through the test page according to the corresponding script.
Optionally, the step of testing the interface to be tested through the test page according to the corresponding script includes:
integrating the type of the interface to be tested into the modeling result according to the corresponding script to obtain a new modeling result;
generating a second test case according to the new modeling result;
and according to the second test case, testing the interface to be tested through the test page.
The embodiment of the application also provides a test page generating device, which comprises:
the modeling module is used for obtaining a modeling result through a pre-established model, wherein the model is constructed based on interface parameters and a decision table;
the configuration module is used for carrying out parameter configuration on the modeling result;
the generation module is used for generating a first test case according to the modeling result after the parameter configuration and generating a test page based on the modeling result after the parameter configuration and the first test case.
The embodiment of the application also provides a terminal device, which comprises a memory, a processor and a test page generating program stored on the memory and capable of running on the processor, wherein the test page generating program is configured to realize the steps of the test page generating method.
The embodiment of the application also provides a storage medium, wherein the storage medium stores a test page generation program, and the test page generation program realizes the steps of the test page generation method when being executed by a processor.
The test page generation method, the test page generation device, the terminal equipment and the storage medium provided by the embodiment of the application obtain a modeling result through a pre-established model, wherein the model is constructed based on interface parameters and a decision table; parameter configuration is carried out on the modeling result; generating a first test case according to the modeling result after the parameter configuration; and generating a test page based on the modeling result after parameter configuration and the first test case. According to the scheme, modeling operation is carried out through a flow modeling platform according to parameters of the interface and the decision table, a test case is generated, and a corresponding test page is generated according to the test case, so that the cost of developing the test page is reduced, the preparation workload of testing is reduced, and the procedure of developing the test page is simplified.
Drawings
FIG. 1 is a schematic diagram of functional modules of a terminal device to which a test page generating device of the present application belongs;
FIG. 2 is a flowchart illustrating a first exemplary embodiment of a test page generation method according to the present application;
FIG. 3 is a flowchart illustrating a second exemplary embodiment of a test page generation method of the present application;
FIG. 4 is a flowchart illustrating a third exemplary embodiment of a test page generation method according to the present application;
fig. 5 is a schematic flow chart of test page generation involved in a specific scenario example in the test page generation method of the present application.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The main solutions of the embodiments of the present application are: acquiring interface parameters and a decision table; modeling the interface parameter relation through a flow modeling platform according to the interface parameters and the decision table, and configuring a modeling result; generating a test case according to the configured modeling result, and managing the test case; and generating a test page based on the modeling result and the test case. According to the scheme, based on the modeling result and the test case, the test page can be generated, so that the cost of development of the test page is reduced, the preparation workload of the test is reduced, the procedure of development of the test page is simplified, the manual test and verification by a tester are facilitated, the efficiency of interface development and test is improved, the manual operation and error are reduced, and the reliability and stability of the system are improved.
In the embodiment of the application, the test page is developed based on the H5 front end in the related technology, and a tester is required to write the test page, so that the interface is tested, the preparation workload of developing the test page based on the method is large, the procedure is complex, and the development cost is not favorably saved.
Based on this, the embodiment of the application provides a solution, which can reduce the cost of test page development, reduce the preparation workload of test, and simplify the procedure of test page development, thereby facilitating the manual test and verification of testers, improving the efficiency of interface development and test, reducing manual operation and errors, and improving the reliability and stability of the system.
Specifically, referring to fig. 1, fig. 1 is a schematic diagram of functional modules of a terminal device to which a test page generating apparatus of the present application belongs. The test page generating means may be a data processing capable means independent of the terminal device, which may be carried on the terminal device in the form of hardware or software. The terminal device may be an intelligent mobile terminal with a touch screen, such as a mobile phone, a computer, etc., and the embodiment uses the computer as an example.
In this embodiment, the terminal device to which the test page generating apparatus belongs at least includes a flow modeling module 110, a processor 120, a memory 130, and a generating module 140.
The memory 130 stores an operating system and a test page generating program, and the test page generating device may store the acquired interface parameters, the call script, the decision table, and the information such as the test cases generated according to the interface parameters and the decision table in the memory 130; the flow modeling module 110 converts the parametric relationships of the interfaces into executable test flows and test cases, providing a basis for the generation of test pages. The generating module 140 can generate a corresponding test page according to the test case and perform management deployment.
Wherein the test page generation program in the memory 130, when executed by the processor, performs the steps of:
obtaining a modeling result through a pre-established model, wherein the model is constructed based on interface parameters and a decision table;
parameter configuration is carried out on the modeling result;
generating a first test case according to the modeling result after the parameter configuration;
and generating a test page based on the modeling result after parameter configuration and the first test case.
Further, the test page generator in the memory 130, when executed by the processor, also performs the steps of:
defining data input by an interface to obtain interface parameters;
acquiring parameter information related to an interface to be tested by inquiring a definition document of the interface to be tested;
and generating a decision table according to the parameter information related to the interface to be tested.
Further, the test page generator in the memory 130, when executed by the processor, also performs the steps of:
generating an interface parameter template according to the decision table;
determining the relation between the interface parameters according to the interface parameter template;
determining a serial path and a combined value between the interface parameters through a flow modeling platform based on the relation between the interface parameters;
and obtaining a modeling result according to the serial paths and the combined values among the interface parameters.
Further, the test page generating program in the memory 130, when executed by the processor, further comprises the following steps:
and carrying out parameter configuration on the modeling result to obtain a modeling result after parameter configuration, wherein the parameter configuration comprises environment preparation, test case generation and test page deployment middle stage.
Further, the test page generator in the memory 130, when executed by the processor, also performs the steps of:
generating a first test case according to the modeling result after the parameter configuration;
naming, screening and sorting the first test cases to obtain a sorting result of the first test cases;
and generating a test page according to the sequencing result of the first test case.
Further, the test page generator in the memory 130, when executed by the processor, also performs the steps of:
determining a modeling path and an order of generating test cases according to the sequencing result of the first test cases;
combining the interface parameters according to the modeling path and the sequence of generating the test cases to generate corresponding test cases;
and generating a test page based on the corresponding test case.
Further, the test page generator in the memory 130, when executed by the processor, also performs the steps of:
generating a script based on different interface types;
invoking the script to traverse the corresponding test case to obtain a corresponding script;
and testing the interface to be tested through the test page according to the corresponding script.
Further, the test page generator in the memory 130, when executed by the processor, also performs the steps of:
integrating the type of the interface to be tested into the modeling result according to the corresponding script to obtain a new modeling result;
generating a second test case according to the new modeling result;
and according to the second test case, testing the interface to be tested through the test page. According to the scheme, the interface parameters and the decision table are obtained; modeling the interface parameter relation through a flow modeling platform according to the interface parameters and the decision table, and configuring a modeling result; generating a test case according to the configured modeling result, and managing the test case; and generating a test page based on the modeling result and the test case. According to the scheme, based on the modeling result and the test case, the test page can be generated, so that the cost of development of the test page is reduced, the preparation workload of the test is reduced, the procedure of development of the test page is simplified, the manual test and verification by a tester are facilitated, the efficiency of interface development and test is improved, the manual operation and error are reduced, and the reliability and stability of the system are improved.
Based on the above terminal device architecture, but not limited to the above architecture, the method embodiments of the present application are presented.
Referring to fig. 2, fig. 2 is a flowchart of a first exemplary embodiment of a test page generating method of the present application. The test page generation method comprises the following steps:
and step S10, obtaining a modeling result through a pre-established model, wherein the model is constructed based on interface parameters and a decision table.
In the APP development process, in order to test the correctness and stability of the mobile client interface, a test page needs to be generated to simulate the operation and input of the user. In this embodiment, the generation of the test page needs to be established through the flow modeling platform based on the interface parameters and the decision table to obtain the modeling result, so as to generate the corresponding test case, so as to generate the test page by executing the corresponding test case.
The interface parameters can comprise input parameters, output parameters, data types of the parameters, priority value ranges of the parameters, constraint conditions of the parameters and the like;
decision table a table tool for describing the decision logic and behavior of an interface. The input, output, condition and decision result of the interface are organized and displayed in the form of a table, so that developers, testers or other related personnel can conveniently understand and implement the logic of the interface;
the process modeling platform is a software tool or platform that helps users design, build, and manage business processes. It provides a visual way to describe and define business processes, including various links, steps, conditions, and flow rules of the process. Through the flow modeling platform, a user may create a flow chart, flow model, or flow diagram to better understand and manage business processes.
Specifically, before the modeling result is obtained through a pre-established model, the interface parameters and the decision table need to be acquired.
Firstly, according to the function and business logic of the interface to be tested, the input parameters to be received of the interface to be tested are determined.
And then, according to the interface definition document, acquiring information such as the name, the type, the value range and the like of the interface parameters.
Then, defining the structure and format of the interface input data according to the acquired parameter information;
and then, inquiring an interface definition document to be tested through the client interface to acquire detailed information such as names, types, value ranges, constraint conditions and the like of interface parameters, wherein the interface definition document to be tested is a document record for providing the client interface in a JsBridge (JavaScript Bridge ) form.
And finally, creating a corresponding decision table according to the parameter information related to the interface to be tested. The specific creation process is as follows:
specifically, according to the names of the interface parameters, creating columns of a decision table, and marking the parameters corresponding to each column;
determining an input mode and an input range of each parameter according to the type and the value range of the interface parameter;
creating a row of a decision table according to the conditions and the decision result of the interface, and filling in the corresponding conditions and the decision result;
according to the constraint conditions and logic of the interface, other relevant information in the decision table, such as combination of conditions, processing of decision results and the like, is filled in.
After the interface parameters and the decision table are acquired, the interface parameters and the decision table are imported into a process modeling platform, and the process modeling platform models based on the imported interface parameters and decision table to obtain a modeling result.
In summary, from interface definition, the difficulty of testing design parameter combination can be weakened through the form of a decision table; the method has the advantages that the visualization of test design is better through the way of listing parameter enumeration values by the flow modeling and decision table, the modeling efficiency and accuracy are improved, meanwhile, the management and maintenance of the model are facilitated, and the application and integration of modeling results are further promoted.
And step S20, carrying out parameter configuration on the modeling result.
The self-running parameter configuration comprises methods of environment preparation, code case generation, automatic test page deployment middle stage and the like. The specific configuration process is as follows:
in particular, a corresponding environment needs to be prepared before the automated parameter configuration takes place. Such as flow modeling platforms, automated test tools, deployment tools, etc., ensure that the environment is able to support the operation of automated parameter configuration.
Depending on the modeling results, an automated script or code generation tool may be used to generate corresponding code cases, such as JS cases (JavaScript, scripting programming language). These code cases may generate corresponding code segments or test cases based on the relationships between the parameters and the combined values. The workload of manually writing codes can be reduced, and the generated codes are ensured to meet the requirements of modeling results.
Based on the modeling results and the generated code cases, an automated deployment tool may be used to automatically deploy the middle stage of the test page.
Parameter configuration and test page deployment can be conveniently carried out through the test page middle platform, and the time and workload of manual operation are reduced.
By the method, automatic parameter configuration of modeling results can be realized. Therefore, the working efficiency can be improved, the manual errors are reduced, and the consistency and the accuracy of parameter configuration are ensured. Meanwhile, the automatic parameter configuration can provide more flexible configuration options and a rapid deployment process, so that the system development and test speed is increased.
And step S30, generating a first test case according to the modeling result after the parameter configuration.
Specifically, firstly, analyzing a configured modeling result, including a structure, parameter setting, logic relation and the like of a model;
and then, determining the coverage range of the test, namely the part to be tested and the critical path according to the complexity of the modeling result and the limitation of the test resources. Therefore, the effectiveness and the high efficiency of the test work can be ensured, and the waste of resources on unnecessary tests is avoided.
Then, a first test case is generated according to the modeling result, namely the test target and the test coverage. The first test case should include information such as input data, expected output, test procedure, etc. to ensure the comprehensiveness and accuracy of the test.
Finally, naming, screening, and sorting the generated test cases, wherein naming the test cases allows the first test case to be easily identified and understood, and screening the first test case allows the most important and representative test cases to be selected.
And sequencing the first test cases based on the named and screened first test cases, and better organizing and executing the test work according to the execution sequence of the first test cases.
In summary, the modeling result is analyzed, the test coverage is determined, the test cases are generated, and naming, screening and sequencing are performed, so that the comprehensiveness, effectiveness and high efficiency of the test work are ensured, and the reliability of the test is improved.
And step S40, generating a test page based on the modeling result after parameter configuration and the first test case.
Specifically, first, a modeling path and a generation sequence of test cases are determined based on the modeling result after the parameter configuration and the first test case.
Wherein, the modeling path refers to a system behavior path defined in the modeling process, and describes the execution flow of the system under different conditions;
the first test case refers to a test case that is first generated during the test, and may be used as a starting point to determine the order in which the test cases are generated. From the first described test cases and test targets, the order in which the test cases were generated, i.e. which test cases should be generated first and which test cases can be generated later, can be determined.
By analyzing the modeling results and the first test cases, different modeling paths of the system can be determined, as well as their order of generation.
Then, according to the modeling path and the generation sequence of the test cases, the combination mode of interfaces and interface parameters required to be called by each test case can be determined, and corresponding test cases are generated.
When the interface parameters are combined, different parameter value ranges, data types and combination modes can be considered to cover different execution conditions of the system.
By combining the interface parameters, corresponding test cases can be generated, including normal test cases, abnormal test cases, boundary value test cases, and the like.
Then, according to the corresponding test cases, corresponding test pages can be generated for executing the test cases and recording test results.
The test page may include, among other things, a description of the test case, a setting of input parameters, a definition of the expected results, a record of the actual results, and so on.
Through the test page, test cases can be conveniently executed, and interface test procedures and results can be recorded for subsequent analysis and verification.
And finally, deploying the generated test page to a test management center for management. When the interface to be tested is to be tested, the test management center can provide a fixed entry of the test page, the test page is automatically entered through the fixed entry, an interface type summarizing menu is stored on the test page, the interface type summarizing menu is matched with a corresponding test case, and the interface to be tested is tested according to the corresponding test case. The test page can be entered by manually scanning the two-dimension code through a shortcut entry of the test page provided by the test management platform. During testing, the execution result can be checked by clicking the test page control.
The fixed inlet and the quick inlet provided by the test tube center table can facilitate the test of the interface to be tested, reduce complicated operation steps and possible errors and improve the efficiency and the accuracy of the test. Meanwhile, the testing process is more standardized and controllable, and the quality and reliability of the test are improved.
Through the steps, the modeling path and the sequence of generating the test cases can be determined according to the modeling result and the first test case after parameter configuration, the interface parameters are combined to generate corresponding test cases, and the test page is generated based on the corresponding test cases so as to perform test execution and result recording. Because of the one-to-one mapping relation between the test design and the test pages, the naming and style styles of the interface check test pages are unified, the familiarity cost of the test pages is reduced, and the test execution is facilitated.
Through the scheme of the embodiment, a modeling result is obtained through a pre-established model, wherein the model is constructed based on interface parameters and a decision table; parameter configuration is carried out on the modeling result; generating a first test case according to the modeling result after the parameter configuration; and generating a test page based on the modeling result after parameter configuration and the first test case. According to the scheme, based on the modeling result and the test case, the test page can be generated, so that the cost of development of the test page is reduced, the preparation workload of the test is reduced, the procedure of development of the test page is simplified, the manual test and verification by a tester are facilitated, the efficiency of interface development and test is improved, the manual operation and error are reduced, and the reliability and stability of the system are improved.
Further, referring to fig. 3, fig. 3 is a schematic flow chart of a second exemplary embodiment of the present application, which is based on the above-mentioned fig. 2. Step S20, modeling by a process modeling platform based on the interface parameter relationship according to the interface parameter and the decision table, and further refining the configuration of the modeling result, including:
s21, generating an interface parameter template according to the decision table;
step S22, determining the relation between the interface parameters according to the interface parameter template;
step S23, determining a serial path and a combined value between the interface parameters through a flow modeling platform based on the relation between the interface parameters;
and step S24, obtaining a modeling result according to the serial paths and the combined values among the interface parameters.
The interface parameter template refers to a template or specification for defining interface parameters when performing interface test. The parameter template can comprise information such as data type, value range, necessary filling item, default value and the like of the interface parameters, and the relation and combination mode among the parameters.
In contrast to the embodiment shown in fig. 2 described above, this embodiment further includes an operation of modeling according to the relationship between the decision table and the interface parameters.
Specifically, in the present embodiment, when the conversion tool receives the document record provided by the client interface, the decision table generation tool is operated to obtain the modeling decision table and the parameter verification decision table.
And generating an interface parameter template according to the modeling decision table, wherein the interface parameter template takes a condition column in the modeling decision table as a parameter name, and sets a corresponding parameter type and a corresponding value range according to the data type and the value range of the parameters of the condition column.
The interface parameter template is handed to a test designer, the test designer can determine possible values of each parameter according to the parameter checking decision table, and fill the values into the interface parameter template, and for some commonly used necessary measured values, an automatic filling mode can be used for filling the interface parameter template. For example, a list of common comparison measurements may be preset, and when a test designer selects a certain parameter, the system may automatically populate the common comparison measurements for that parameter.
The relationship between the interface parameters is determined according to the interface parameter template after completion of filling, for example, an interface parameter indicates a date range, and it may be necessary to provide a start date and an end date at the same time. In the interface parameter templates, such relationships may be represented by defining a combined relationship.
After the relationship between the interface parameters is determined, a flow chart is drawn on the interface parameters through a flow modeling platform based on the relationship between the interface parameters, and in the flow chart, parameter series paths and combination values can be designed, wherein the series paths describe the dependency relationship and the combination relationship between the parameters, and the combination values represent different combination modes of the parameters. On the flow modeling platform, notes, tags, or other means may also be used to define the desired results. For example, an annotation is added to a node describing the expected output or result of an operation of that node.
And finally, completing modeling according to the serial paths and the combined values among the interface parameters to obtain a modeling result. The modeling result may be a flow chart describing the relationships between parameters and the flow of operations.
In the scheme of the embodiment, the automation and optimization of the parameter configuration process are realized through analysis, relation determination and modeling of the interface parameters. The efficiency and the accuracy of parameter configuration can be improved, the workload of manual operation is reduced, and the consistency and the repeatability of the parameter configuration are ensured.
Further, referring to fig. 4, fig. 4 is a schematic flow chart of a third exemplary embodiment of the present application, which is based on the above-mentioned fig. 2. Step S40, after the step of generating a test page based on the modeling result and the corresponding test case, further includes:
step S41, generating scripts based on different interface types;
step S42, calling the script to traverse the first test case to obtain a corresponding script;
and step S43, testing the interface to be tested through the test page according to the corresponding script.
Specifically, according to different interface types, a script is generated, and the script is called to traverse the first test case to obtain a corresponding script, so that the interface can complete test work under different conditions. And the first test case is a set of basic test cases for the interface for detecting basic functions and performance of the interface. The correctness and stability of the interface under different conditions can be ensured by calling the script to traverse the first test case, and the traversed test case can cover different test scenes and boundary conditions to find potential problems and errors.
In the development process, when the interface to be tested is required to be tested, a corresponding script can be called to test the interface to be tested. The specific working principle is as follows:
specifically, firstly, a corresponding script is called, and the interface to be tested is integrated into a previous modeling result, namely, relevant information such as parameters, relations, paths and the like of the interface to be tested is added into the modeling result to obtain a new modeling result so as to generate a corresponding test case subsequently.
And then, generating a second test case according to the new modeling result, wherein the second test case is generated according to the type of the interface to be tested and is used for detecting the function and the performance of the interface to be tested. The second test case may include different test scenarios, boundary conditions, and anomalies, depending on the different characteristics and requirements of the interface under test.
And finally, testing the interface to be tested by using a test page according to the second test case. Through the test page, the comprehensive function and performance test can be performed on the interface to be tested.
Through the scheme of the embodiment, the calling script is generated and the test is executed, so that the interface is comprehensively tested and verified, a tester can be helped to quickly and accurately test the interface, the test efficiency and the test coverage rate are improved, and the quality and the stability of the interface are ensured.
The following describes the embodiment in detail with reference to specific scenarios:
for example, take the generation of a mobile client APP test page as an example. A specific flow diagram of the mobile client APP test page is generated, as shown in fig. 5.
When a tester needs to perform interface test on the mobile client APP, the method of data preparation, test page generation, test page automatic deployment and the like is defined through a conversion tool, the method of data preparation, test page generation, test page automatic deployment and the like is performed on functions through an automatic configuration deployment platform, a file is generated, and when a flow chart is built, automatic parameter configuration is performed on the mobile client APP interface parameters through the file.
Then, defining an interface document to be tested through the client interface, and sending the interface document to be tested to a conversion tool. The conversion tool provides a decision table generating tool, and the decision table generating tool obtains and generates a parameter verification decision table and a modeling decision table corresponding to the mobile client APP according to the received interface document to be tested.
When the decision table generating tool is operated, an interface parameter template is generated according to the format of the modeling decision table, wherein the interface parameter template comprises the mobile client APP interface name, the mobile client APP interface type, the mobile client APP interface parameter path and the like. The test designer can fill in parameter enumeration values according to the requirements, and the common necessary measurement values can be automatically filled.
And importing the modeling decision table and the parameter verification decision table into a process modeling platform L2 layer file, and determining the relation between the parameters of the mobile APP interface to be tested according to the modeling decision table and the parameter verification decision table.
And designing a parameter series path and a combination value between the parameter series path and the combination value according to the relation between the mobile APP interface parameters to be tested, marking an expected result, completing modeling, obtaining a modeling result based on the mobile client APP interface parameters, and configuring the modeling result, wherein the method comprises the steps of environment preparation, JS case generation, automatic test page deployment middle platform and the like.
Then, a case is generated according to the modeling result, and naming, screening, sorting and other operations are performed on the case so as to be executed as a test case.
And running a test page generation module, generating a test page corresponding to the mobile client APP according to the test case, and automatically deploying the test page to a client test management center.
The client test management center can manage the test page, provide a plurality of options such as a fixed entry, a shortcut entry and the like, and also support detail adjustment such as downloading, uploading and the like. When a tester needs to test other mobile client APP interfaces, the mobile client APP interfaces can be detected by entering the test page through the mobile client fixed entrance, and whether the mobile client APP has flash back and other conditions can be detected.
And generating corresponding calling scripts according to different interface types, and traversing the calling scripts through the test cases to ensure that the interfaces can finish test work under different conditions.
When the mobile client APP to-be-tested interface needs to be checked, a corresponding script is called, the mobile client APP to-be-tested interface is integrated into a previous modeling result, namely, relevant information such as parameters, relations, paths and the like of the mobile client APP to-be-tested interface is added into the modeling result, and a new modeling result is obtained.
And then, generating a second test case according to the new modeling result, wherein the second test case is a test case of the APP to-be-tested interface of the mobile client and is used for detecting the functions and the performances of the APP to-be-tested interface of the mobile client.
And finally, executing a second test case by the interface automation platform, and detecting the newly added mobile client APP interface by using the test page, for example, detecting whether the mobile client APP has flash back or not by clicking the control test page.
Through the steps, the integrated design of test design, test page and interface automation can be realized, and the integrated design is applied to actual work, so that the difficulty of test design is reduced, the workload of test preparation is reduced, and the test assets are reused. The method can also realize the rapid test of the mobile client interface, and provides great convenience for the test work of the mobile client interface class.
In addition, the embodiment of the application also provides a test page generating device, which comprises:
the modeling module is used for obtaining a modeling result through a pre-established model, wherein the model is constructed based on interface parameters and a decision table;
the configuration module is used for carrying out parameter configuration on the modeling result;
the generation module is used for generating a first test case according to the modeling result after the parameter configuration and generating a test page based on the modeling result after the parameter configuration and the first test case.
The principle and implementation process of the test page generation are realized in this embodiment, please refer to the above embodiments, and will not be described in detail herein.
In addition, the embodiment of the application also provides a terminal device, which comprises a memory, a processor and a test page generating program stored on the memory and capable of running on the processor, wherein the test page generating program is configured to realize the steps of the test page generating method.
Because the test page generating program is executed by the processor, all the technical schemes of all the embodiments are adopted, and therefore, the test page generating program has at least all the beneficial effects brought by all the technical schemes of all the embodiments, and is not described in detail herein.
In addition, the embodiment of the application also provides a storage medium, wherein the storage medium stores a test page generation program, and the test page generation program realizes the steps of the test page generation method when being executed by a processor.
Because the test page generating program is executed by the processor, all the technical schemes of all the embodiments are adopted, and therefore, the test page generating program has at least all the beneficial effects brought by all the technical schemes of all the embodiments, and is not described in detail herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (11)

1. The test page generation method is characterized by comprising the following steps of:
obtaining a modeling result through a pre-established model, wherein the model is constructed based on interface parameters and a decision table;
parameter configuration is carried out on the modeling result;
generating a first test case according to the modeling result after the parameter configuration;
and generating a test page based on the modeling result after parameter configuration and the first test case.
2. The test page generating method as claimed in claim 1, wherein the modeling result is obtained by a pre-established model, and the model is constructed based on the interface parameters and the decision table, and further comprising:
defining data input by an interface to obtain interface parameters;
acquiring parameter information related to an interface to be tested by inquiring a definition document of the interface to be tested;
and generating a decision table according to the parameter information related to the interface to be tested.
3. The test page generating method as claimed in claim 1, wherein the step of obtaining the modeling result through a pre-established model, the model being constructed based on the interface parameters and the decision table comprises:
generating an interface parameter template according to the decision table;
determining the relation between the interface parameters according to the interface parameter template;
determining a series path and a combined value between the interface parameters based on the relationship between the interface parameters;
and obtaining a modeling result according to the serial paths and the combined values among the interface parameters.
4. The test page generating method as claimed in claim 1, wherein the step of parameter configuring the modeling result comprises:
and carrying out parameter configuration on the modeling result to obtain a modeling result after parameter configuration, wherein the parameter configuration comprises environment preparation, code case generation and test page deployment middle stage.
5. The test page generating method as claimed in any one of claims 2-4, wherein the step of generating the first test case according to the modeling result after the parameter configuration includes:
generating a first test case according to the modeling result after the parameter configuration;
naming, screening and sorting the first test cases to obtain a sorting result of the first test cases;
and generating a test page according to the sequencing result of the first test case.
6. The test page generating method of claim 5, wherein the step of generating the test page based on the ranked results of the first test case comprises:
determining a modeling path and the sequence of generating the test cases according to the sequencing result of the first test cases;
combining the interface parameters according to the modeling path and the sequence of generating the test cases to generate corresponding test cases;
and generating a test page based on the corresponding test case.
7. The test page generating method as claimed in claim 6, wherein after the step of generating the test page based on the corresponding test case, further comprising:
generating a script based on different interface types;
invoking the script to traverse the corresponding test case to obtain a corresponding script;
and testing the interface to be tested through the test page according to the corresponding script.
8. The test page generating method as claimed in claim 7, wherein the step of testing the interface under test through the test page according to the corresponding script comprises:
integrating the type of the interface to be tested into the modeling result according to the corresponding script to obtain a new modeling result;
generating a second test case according to the new modeling result;
and testing the interface to be tested through the test page according to the second test case.
9. A test page generating apparatus, characterized in that the test page generating apparatus comprises:
the modeling module is used for obtaining a modeling result through a pre-established model, wherein the model is constructed based on interface parameters and a decision table;
the configuration module is used for carrying out parameter configuration on the modeling result;
the generation module is used for generating a first test case according to the modeling result after the parameter configuration and generating a test page based on the modeling result after the parameter configuration and the first test case.
10. A test page generating apparatus, the apparatus comprising: a memory, a processor and a test page generation program stored on the memory and executable on the processor, the test page generation program being configured to implement the steps of the test page generation method of any of claims 1 to 8.
11. A storage medium having stored thereon a test page generation program which, when executed by a processor, implements the steps of the test page generation method of any of claims 1 to 8.
CN202311614908.7A 2023-11-29 2023-11-29 Test page generation method, device, terminal equipment and storage medium Pending CN117609040A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311614908.7A CN117609040A (en) 2023-11-29 2023-11-29 Test page generation method, device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311614908.7A CN117609040A (en) 2023-11-29 2023-11-29 Test page generation method, device, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117609040A true CN117609040A (en) 2024-02-27

Family

ID=89951153

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311614908.7A Pending CN117609040A (en) 2023-11-29 2023-11-29 Test page generation method, device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117609040A (en)

Similar Documents

Publication Publication Date Title
US10642721B2 (en) Generation of automated testing scripts by converting manual test cases
US10127141B2 (en) Electronic technology resource evaluation system
US8522214B2 (en) Keyword based software testing system and method
US9465718B2 (en) Filter generation for load testing managed environments
US7895575B2 (en) Apparatus and method for generating test driver
US11074162B2 (en) System and a method for automated script generation for application testing
CN111124919A (en) User interface testing method, device, equipment and storage medium
US11138097B2 (en) Automated web testing framework for generating and maintaining test scripts
CN110399299B (en) Automated test framework and test case execution method
CN111158656B (en) Test code generation method and device based on fruit tree method
US7272753B2 (en) Methods and apparatus for translating application tests for execution with simulation software tools
US9274933B2 (en) Pretest setup planning
CN111143228B (en) Test code generation method and device based on decision table method
CN112988578A (en) Automatic testing method and device
CN116841543A (en) Development method for dynamically generating cross-platform multi-terminal application based on Flutter
CN116719736A (en) Test case generation method and device for testing software interface
CN116860608A (en) Interface testing method and device, computing equipment and storage medium
Imran et al. A comparative study of QTP and load runner automated testing tools and their contributions to software project scenario
CN117609040A (en) Test page generation method, device, terminal equipment and storage medium
CN111813665A (en) Big data platform interface data testing method and system based on python
CN109669868A (en) The method and system of software test
CN113094281B (en) Test method and device for hybrid App
CN117234946B (en) Automatic test method and related equipment for project library system
US11914503B2 (en) Automated performance measurement over software lifecycle
CN115509923A (en) Unit test case generation method and device and computer 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