Automatic testing method, system, electronic device and storage medium for application

By automatically obtaining and processing application metadata, systematic testing of multiple applications is achieved, which solves the problem of low testing efficiency in the existing technology and improves testing efficiency.

CN113515452BActive Publication Date: 2024-09-27SHENZHEN AOZHE NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110677057.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-18
Publication Date
2024-09-27
Estimated Expiration
2041-06-18

AI Technical Summary

Technical Problem

In the existing technology, when multiple applications need to be tested, different test codes need to be written according to different applications, resulting in low testing efficiency.

Method used

An automatic testing method is proposed, which improves testing efficiency by obtaining the application metadata of the target application, processing and generating test metadata, automatically conducting simulation tests, and automatically generating test data.

Benefits of technology

Users only need to specify the target application to be tested, and the system can automatically load and analyze application metadata, conduct systematic testing, and generate test results, significantly improving application testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113515452B
    Figure CN113515452B
Patent Text Reader

Abstract

The present application discloses an automatic testing method, system, electronic device and storage medium for an application, which are applied to the field of application testing. The automatic testing method for an application of the present application includes: obtaining a target application to be tested, extracting application metadata of the target application to be tested, processing the extracted application metadata to obtain test metadata, testing the target application according to the test metadata, and obtaining application test data. The user only needs to specify the target application to be tested, and the target application can be automatically loaded, extracting and analyzing the application metadata of the target application, obtaining the test metadata of the target application, performing a systematic simulation test on the target application according to the test metadata, automatically generating application test data, and obtaining the test result of the target application, thereby improving the test efficiency of the application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of application testing, and in particular to an automatic testing method, system, electronic device and storage medium for an application. Background Art

[0002] With the gradual deepening of information development, the development speed of software applications is very rapid. In order to ensure the final quality of the application, it is necessary to control the quality of the application during the development process, such as testing the application. Testing the application can timely discover the defects of the application, further optimize the application according to the defects, and ensure the normal use of the application. The current testing method for applications is usually to write test codes suitable for the application according to the specific application. However, when multiple applications need to be tested, different test codes need to be written according to different applications, resulting in low application testing efficiency. Summary of the invention

[0003] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes an automatic testing method, system, electronic device and storage medium for applications, which can perform systematic automatic testing for different applications and improve the testing efficiency of applications.

[0004] The automatic testing method of an application according to the first aspect of the present application includes:

[0005] Get the target application to be tested;

[0006] Extracting application metadata of the target application;

[0007] Processing the application metadata to obtain test metadata;

[0008] The target application is tested according to the test metadata to obtain application test data.

[0009] The automatic testing method of the application according to the embodiment of the present application has at least the following beneficial effects:

[0010] Obtain the target application to be tested, extract the application metadata of the target application to be tested, process the extracted application metadata to obtain test metadata, test the target application according to the test metadata, and obtain application test data. The user only needs to specify the target application to be tested, and the target application can be automatically loaded, extract and analyze the application metadata of the target application, obtain the test metadata of the target application, perform systematic simulation test on the target application according to the test metadata, automatically generate application test data, and obtain the test result of the target application, thereby improving the testing efficiency of the application.

[0011] According to some embodiments of the present application, obtaining a target application to be tested includes:

[0012] Obtain multiple test applications, and obtain domain name information and account information corresponding to each of the test applications;

[0013] The target application is selected from the plurality of test applications according to the plurality of domain name information and the plurality of account information.

[0014] According to some embodiments of the present application, the processing of the application metadata to obtain the test metadata includes:

[0015] Get the preset metadata parsing rules;

[0016] Corresponding application metadata is extracted according to the metadata parsing rule as test metadata.

[0017] According to some embodiments of the present application, the test metadata includes model metadata and page metadata;

[0018] Correspondingly, testing the target application according to the test metadata to obtain application test data includes:

[0019] Acquire multiple page controls of the target application and a test range corresponding to each of the page controls according to the model metadata and the page metadata;

[0020] Generate first test data corresponding to each of the page controls within the test range corresponding to each of the page controls;

[0021] Inputting the first test data corresponding to each of the page controls into each of the page controls to obtain control data corresponding to each of the page controls;

[0022] Compare the first test data and the control data corresponding to each of the page controls to obtain a plurality of first comparison results;

[0023] The application test data is obtained according to the plurality of first comparison results.

[0024] According to some embodiments of the present application, the test metadata includes interface metadata;

[0025] Correspondingly, testing the target application according to the test metadata to obtain application test data includes:

[0026] Acquire multiple application interfaces of the target application and an interface protocol corresponding to each of the application interfaces according to the interface metadata;

[0027] Generate second test data corresponding to each of the application interfaces according to the interface protocol of each of the application interfaces;

[0028] Inputting the second test data corresponding to each of the application interfaces into each of the application interfaces to obtain interface data corresponding to each of the application interfaces;

[0029] Comparing the second test data corresponding to each of the application interfaces with the interface data to obtain a plurality of second comparison results;

[0030] Application test data of the target application is obtained according to the plurality of second comparison results.

[0031] According to some embodiments of the present application, the application metadata includes process metadata;

[0032] Correspondingly, testing the target application according to the test metadata to obtain application test data includes:

[0033] According to the process metadata, obtaining multiple test nodes corresponding to the target application;

[0034] According to the plurality of test nodes, a plurality of test paths are obtained;

[0035] Obtaining page information corresponding to each of the test paths;

[0036] Processing the page information corresponding to each of the test paths to obtain a path test sequence and test metadata corresponding to each of the test paths;

[0037] The target application is tested according to the path test sequence and the test metadata corresponding to each of the test paths to obtain application test data.

[0038] According to some embodiments of the present application, acquiring a plurality of test nodes corresponding to the target application according to the process metadata includes:

[0039] Acquire multiple user accounts corresponding to the target application according to the process metadata;

[0040] A plurality of test nodes corresponding to the target application in the login state of each of the user accounts are obtained.

[0041] An automatic testing system for an application according to a second aspect of the present application includes:

[0042] Acquisition module: The acquisition module is used to acquire the target application to be tested;

[0043] Extraction module: The extraction module is used to extract application metadata of the target application;

[0044] Processing module: the processing module is used to process the application metadata to obtain test metadata;

[0045] Test module: The test module is used to test the target application according to the test metadata to obtain application test data.

[0046] The automatic test system according to the application of the embodiment of the present application has at least the following beneficial effects:

[0047] The automatic testing system for applications in the embodiments of the present application includes: an acquisition module, an extraction module, a processing module and a testing module. The acquisition module acquires a target application to be tested, the extraction module extracts application metadata of the target application to be tested, the processing module processes the extracted application metadata to obtain test metadata, and the testing module tests the target application according to the test metadata to obtain application test data. The user only needs to specify the target application to be tested, and the system can automatically load the target application, extract and analyze the application metadata of the target application, obtain the test metadata of the target application, perform systematic simulation testing on the target application according to the test metadata, automatically generate application test data, and obtain the test result of the target application, thereby improving the testing efficiency of the application.

[0048] An electronic device according to a third aspect of the present application includes:

[0049] at least one processor, and

[0050] a memory communicatively connected to the at least one processor; wherein,

[0051] The memory stores instructions, and the instructions are executed by the at least one processor so that when the at least one processor executes the instructions, an automatic testing method for an application as described in any one of the embodiments of the first aspect of the present application is implemented.

[0052] A computer-readable storage medium according to a fourth aspect of the present application includes:

[0053] The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the automatic testing method of the application as described in the embodiment of the first aspect of the present application.

[0054] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The present application is further described below with reference to the accompanying drawings and embodiments, wherein:

[0056] Figure 1A flowchart of an automatic testing method for an application provided in some embodiments of the present application;

[0057] Figure 2 A specific flow chart of step S100 in the automatic testing method for an application provided in some embodiments of the present application;

[0058] Figure 3 A specific flow chart of step S300 in the automatic testing method for an application provided in some embodiments of the present application;

[0059] Figure 4 A first flow chart of step S400 in the automatic testing method for an application provided in some embodiments of the present application;

[0060] Figure 5 A second flow chart of step S400 in the automatic testing method for an application provided in some embodiments of the present application;

[0061] Figure 6 A third flow chart of step S400 in the automatic testing method for an application provided in some embodiments of the present application;

[0062] Figure 7 A specific flow chart of step S431 in the automatic testing method for an application provided in some embodiments of the present application;

[0063] Figure 8 A specific application flow chart of the automatic testing method for an application provided in some embodiments of the present application;

[0064] Fig. 9 A block diagram of the module structure of an automatic testing system for applications provided in some embodiments of the present application. Description of the drawings:

[0066] Acquisition module 100, extraction module 200, processing module 300, and testing module 400. DETAILED DESCRIPTION

[0067] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0068] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0069] With the gradual deepening of information development, the development speed of software applications is very rapid. In order to ensure the final quality of the application, it is necessary to control the quality of the application during the development process, such as testing the application. Testing the application can timely discover the defects of the application, further optimize the application according to the defects, and ensure the normal use of the application. The current testing method for applications is usually to write test codes suitable for the application according to the specific application. However, when multiple applications need to be tested, different test codes need to be written according to different applications, resulting in low application testing efficiency.

[0070] Based on this, the present application proposes an automatic testing method, system, electronic device and storage medium for an application, which can obtain a target application to be tested, extract application metadata of the target application to be tested, process the extracted application metadata to obtain test metadata, test the target application according to the test metadata, and obtain application test data. The user only needs to specify the target application to be tested, and the target application can be automatically loaded, extract and analyze the application metadata of the target application, obtain the test metadata of the target application, perform systematic simulation testing on the target application according to the test metadata, automatically generate application test data, and obtain the test result of the target application, thereby improving the testing efficiency of the application.

[0071] In a first aspect, an embodiment of the present application provides an automatic testing method for an application.

[0072] Reference Figure 1 , Figure 1 A flowchart of an automatic testing method for an application provided in some embodiments of the present application, specifically comprising the steps of:

[0073] S100, obtaining a target application to be tested;

[0074] S200, extracting application metadata of the target application;

[0075] S300, processing the application metadata to obtain test metadata;

[0076] S400: Testing the target application according to the test metadata to obtain application test data.

[0077] In step S100, the target application to be tested is obtained. In actual applications, the target application to be tested can be built through a low-code development platform (LCDP), wherein the low-code development platform is a development platform that can quickly generate applications without coding or with a small amount of code. The method of visual application development allows developers with different experience levels to create web pages and mobile applications through a graphical user interface, using drag-and-drop components and model-driven logic. The low-code development platform can build the required functions such as business processes, logic and data models, and can add its own code when necessary. After completing the construction of business logic and functions, the application can be delivered and updated with one click, automatically tracking all changes and processing database scripts and deployment processes, and realizing deployment on multiple platforms such as IOS, Android, and Web. This application can obtain applications built through the low-code development platform as target applications to be tested, and test the target applications.

[0078] In some embodiments, Figure 2 As shown, step S100 specifically includes the following steps:

[0079] S110, obtaining multiple test applications, and obtaining domain name information and account information corresponding to each test application;

[0080] S120, selecting a target application from multiple test applications according to multiple domain name information and multiple account information.

[0081] In step S110, multiple test applications are obtained, and the domain name information and account information corresponding to each test application are obtained. The embodiment of the present application can obtain multiple test applications that request testing, and obtain the domain name information and account information corresponding to the test applications, wherein the domain name information is the name of a computer or computer group on the Internet composed of a string of names separated by dots, which is used to locate the computer during data transmission. The domain name information and the IP address are mapped to each other. The target application can be accessed by obtaining the domain name information of the test application. The account information includes the user name and user password registered in the test application.

[0082] In step S120, a target application is selected from multiple test applications based on multiple domain name information and multiple account information. Since the domain name information identifies the target application in multiple test applications, and the account information identifies the specific account logged in in the target application and the login interface of the target application, the domain name information and the account information are combined to automatically identify and distinguish the target application, and test the target application under the specified domain name information and account information. In actual applications, the embodiment of the present application can automatically obtain the test application and application data of the test application built by the low-code development platform, and the same automatic testing method can be used to test these applications for applications built by the low-code development platform, without rewriting the test code for a single test application built by the low-code development platform, which enhances the reusability of the test method, so that the automatic testing method of the application of the embodiment of the present application can be applied to more applications, and due to the characteristics of the low-code development platform, the embodiment of the present application does not need to check the project code, greatly reducing the time and communication cost of the test, reducing the occupancy of storage resources and computing resources, and improving development efficiency. Different test applications can be automatically identified and distinguished by domain name and application ID, and the target application can be selected from multiple test applications to perform automated testing on the target application.

[0083] In step S200, the application metadata of the target application is extracted, wherein the application metadata is also called intermediary data or relay data, which is mainly information describing data attributes and is used to support functions such as indicating storage location, historical data, resource search, and file records. In actual applications, the target application built through the low-code development platform is driven by application metadata. To extract the application metadata of the target application, an interface request for extracting the application metadata is first generated, and then the application metadata of the target application is extracted through the interface request.

[0084] In step S300, the application metadata is processed to obtain test metadata, and the test metadata is used to test the target application.

[0085] In some embodiments, Figure 3 As shown, step S300 specifically includes the following steps:

[0086] S310, obtaining a preset metadata parsing rule;

[0087] S320, extracting corresponding application metadata according to the metadata parsing rule as test metadata.

[0088] In step S310, a preset metadata parsing rule is obtained. For example, in the embodiment of the present application, multiple types of metadata need to be obtained, and the metadata parsing rule can be formulated according to a unique field for identifying different types of metadata.

[0089] In step S320, the corresponding application metadata is extracted according to the metadata parsing rules as test metadata. The embodiment of the present application can obtain multiple unique fields in the test application, and the corresponding metadata can be obtained according to these unique fields as test metadata, and relevant information of the model design can be obtained from the test metadata.

[0090] In step S400, the target application is tested according to the test metadata to obtain application test data. When the user only needs to automatically test the target application or test all test applications by default, the selected target application can be automatically loaded, the application metadata of the target application can be analyzed to obtain test metadata, and then a systematic simulation test is performed according to the test metadata to automatically generate application test data. Based on the generated application test data, an application test conclusion can be obtained, and whether the automated test of the target application has passed can be determined based on the application test conclusion.

[0091] In some embodiments, Figure 4 As shown, step S400 specifically includes the following steps:

[0092] S411, acquiring multiple page controls of the target application and a test range corresponding to each page control according to the model metadata and the page metadata;

[0093] S412, generating first test data corresponding to each page control within a test range corresponding to each page control;

[0094] S413, inputting first test data corresponding to each page control into each page control to obtain control data corresponding to each page control;

[0095] S414, comparing the first test data and the control data corresponding to each page control to obtain a plurality of first comparison results;

[0096] S415, obtaining application test data according to the multiple first comparison results.

[0097] In some embodiments, the test metadata includes model metadata and page metadata, wherein model metadata refers to the domain data of the target application, including data-type metadata such as domain modeling and domain model, which represents the organization form of data in the database during the operation of the application page, and page metadata includes the metadata of the target application. The front-end data of the target application can be parsed through the page metadata, including controls, elements and their attributes, bound events, etc. In the embodiments of the present application, the model metadata and page metadata are obtained to test the front-end page of the target application, specifically including whether the page controls at the front end of the application, such as text box controls, drop-down item controls, radio controls, switch controls, check box controls, rich text controls, shuttle box controls, address controls, and date controls, are normal.

[0098] In step S411, multiple page controls of the target application and the test range corresponding to each page control are obtained according to the model metadata and the page metadata. Specifically, the required controls on the front-end page of the target application and the test range corresponding to the controls are found according to the model metadata and the page metadata. Specifically, it can be the range of data input. For example, the required controls, such as the user name, and the test range corresponding to the controls are obtained on the front-end page of the target application according to the model metadata and the page metadata. For example, the input range of the control can only be specified as 0 to 10 characters, so the test range corresponding to the control is 0 to 10 characters, that is, the test data can only test the control within the test range. In actual applications, according to the model metadata and the page metadata, use sel Selenium performs UI input operations on the target application, and the obtained test metadata contains information such as the id of the control in the page. Selenium can locate the control through the id of the control and other information, and then simulate human manual operations to achieve automated input and submission. Selenium is an automated testing tool for Web applications. Selenium tests run directly in the browser, just like real users are operating. The main functions of selenium include: testing compatibility with the browser, that is, testing the target application program to see if the target application can work normally on different browsers and operating systems, and testing system functions, that is, creating regression tests to verify software functions and user needs.

[0099] In step S412, within the test range corresponding to each page control, first test data corresponding to each page control is generated. The first test data can only be selected within the test range corresponding to the page control. A random selection method can be used to input the first test data that meets the input range of the page control. For example, if the input range of a certain control is 0 to 10 characters, the range of the first test data is randomly selected within the range of 0-10, and the first test data is randomly generated according to the range of the first test data.

[0100] In step S413, the first test data corresponding to each page control is input into each page control to obtain control data corresponding to each page control. The control data in the embodiment of the present application refers to the output feedback data obtained after the first test data is input into the specified control.

[0101] In step S414, the first test data and control data corresponding to each page control are compared to obtain multiple first comparison results. Specifically, the control data obtained after the first test data is input into the control is read, and the consistency of the read data and the input data is compared. The first comparison result indicates whether the read data is consistent with the input data. The first comparison result includes consistency and inconsistency. According to the first comparison result, it can be determined whether the function of the control is normal.

[0102] In step S415, application test data is obtained based on multiple first comparison results. Based on the multiple first comparison results, it can be determined whether multiple controls on the front-end page of the target application function normally, so that the user can clearly understand the parts of the target application where the functions are abnormal and can optimize the abnormal parts in time.

[0103] In some embodiments, Figure 5 As shown, step S400 specifically further includes the steps of:

[0104] S421, acquiring multiple application interfaces of the target application and an interface protocol corresponding to each application interface according to the interface metadata;

[0105] S422, generating second test data corresponding to each application interface according to the interface protocol of each application interface;

[0106] S423, inputting second test data corresponding to each application interface into each application interface to obtain interface data corresponding to each application interface;

[0107] S424, comparing the second test data corresponding to each application interface with the interface data to obtain a plurality of second comparison results;

[0108] S425, obtaining application test data of the target application according to the plurality of second comparison results.

[0109] In some embodiments, the test metadata includes interface metadata, wherein the interface metadata includes the protocol and process configuration adopted by the target application. The present application obtains the interface metadata and tests the target application according to the interface metadata. The application is mainly used to test the system component interfaces in the target application, and is also used to detect the interaction points between the external system and the present system and between the internal subsystems. The interface test needs to check the data exchange, transmission and control management process, as well as the mutual logical dependencies between systems.

[0110] In step S421, multiple application interfaces of the target application and the interface protocols corresponding to each application interface are obtained according to the interface metadata. The application interface mentioned in the embodiment of the present application refers to the application programming interface, referred to as API (Application Programming Interface), which is the agreement for connecting different components of the software system. The interface protocol mentioned in the embodiment of the present application includes the swagger interface protocol, where swagger is a standardized and complete framework for generating, describing, calling and visualizing Web services, and supports API automatic generation of synchronized online documents. After using swagger, documents can be generated directly through code without manual writing of interface documents, which can save time in writing interface documents and improve testing efficiency.

[0111] In step S422, second test data corresponding to each application interface is generated according to the interface protocol of each application interface. Different interface protocols correspond to different second test data. In actual applications, the swagger interface protocol of the target application can be read, and the corresponding second test data can be obtained through the Python API.

[0112] In step S423, the second test data corresponding to each application interface is input into each application interface to obtain the interface data corresponding to each application interface. In actual applications, the Python API inputs the second test data into the application interface, and then reads the data returned by the application interface, which is the interface data mentioned in the embodiment of the present application.

[0113] In step S424, the second test data and interface data corresponding to each application interface are compared to obtain multiple second comparison results. Specifically, the second test data and the interface data are compared to see whether they are consistent. The second comparison result indicates whether the second test data and the interface data are consistent. The second comparison result includes consistency and inconsistency. Based on the second comparison result, it can be determined whether the application interface of the target application is normal.

[0114] In step S425, application test data of the target application is obtained based on multiple second comparison results. Based on the multiple second comparison results, it can be determined whether multiple application interfaces of the target application are normal, so that the user can clearly understand the application interfaces of the target application with functional abnormalities and can optimize the abnormal parts in time.

[0115] In some embodiments, Figure 6 As shown, step S400 specifically further includes the steps of:

[0116] S431, acquiring multiple test nodes corresponding to the target application according to the process metadata;

[0117] S432, obtaining multiple test paths according to the multiple test nodes;

[0118] S433, obtaining page information corresponding to each test path;

[0119] S434, processing the page information corresponding to each test path to obtain a path test sequence and test metadata corresponding to each test path;

[0120] S435 , testing the target application according to the path test sequence and the test metadata corresponding to each test path to obtain application test data.

[0121] In some embodiments, the application metadata includes process metadata, and the process metadata represents data information of each test node in the test process.

[0122] In some embodiments, application metadata includes domain metadata, wherein the domain metadata includes the logical model, relational model, and physical model of the target application. According to the domain metadata of the target application, form- and process-based test programs and test data can be automatically generated to perform data-driven simulation.

[0123] In step S431, according to the process metadata, multiple test nodes corresponding to the target application are obtained. The process metadata of the embodiment of the present application is used to store the test process information of the target application. The process metadata is suitable for testing complex process applications. Since the process contains multiple nodes, different operations correspond to different nodes. The nodes with different operations are called test nodes. Since each node in the test process may contain multiple operations, such as consent, transfer and review operations, each type of operation is a test node for the node, and each execution path only contains a certain operation in each test node, so multiple test nodes can generate multiple execution paths. In actual applications, the test node, the domain model bound to the test node, the test node execution path and the participants of the test node execution logic node can be obtained through process metadata analysis. According to the parsed domain model, the page metadata of the target application can be obtained. The page metadata mainly includes the page control id and whether it is the input type of the control type bound to the system control. According to the page metadata, the page element id and page element can be obtained, providing data support for automated testing.

[0124] In some embodiments, Figure 7 As shown, step S431 specifically includes the steps of:

[0125] S4311, obtaining multiple user accounts corresponding to the target application according to the process metadata;

[0126] S4312, obtaining multiple test nodes corresponding to the target application in the login state of each user account.

[0127] In step S4311, multiple user accounts corresponding to the target application are obtained according to the process metadata. Since the target application involves a process type, it involves multiple process nodes, and each node requires different users to perform similar approval operations. Therefore, it is necessary to obtain the group or organization in the RBAC permission management design of the target application, that is, the organizational information. RBAC is an effective access control method for implementing enterprise security policies. Its basic idea is that various permissions for system operations are not directly granted to specific users, but a role set is established between the user set and the permission set. Each role corresponds to a set of corresponding permissions. Once the user is assigned an appropriate role, the user has all the operation permissions of this role. The advantage of this is that it is not necessary to assign permissions every time a user is created. It is sufficient to assign the user to the corresponding role, and the permission changes of the role are much less than the permission changes of the user. This will simplify the user's permission management and reduce the system overhead. The organizational information of the embodiment of the present application includes all the user information involved in the target application. Different users have different interfaces when opening the target application, and the functions they implement are also different, so it is necessary to obtain the user accounts of multiple users corresponding to different operation permissions.

[0128] In step S4312, multiple test nodes corresponding to the target application in the login state of each user account are obtained. Since users have different operating permissions, in order to make the test results more accurate and cover all execution paths as much as possible, it is necessary to obtain multiple test nodes corresponding to different users logging into the target application to generate test paths.

[0129] In step S432, multiple test paths are obtained according to the multiple test nodes. The test paths refer to all operable paths of the target application, such as the process operation path and the form filling submission path in the target application.

[0130] In step S433, the page information corresponding to each test path is obtained. The page information mainly includes page controls of the target application front-end page, such as forms, etc. The corresponding page metadata is extracted according to the page information, and the page controls of the target application are tested according to the page metadata.

[0131] In step S434, the page information corresponding to each test path is processed to obtain the path test sequence and the test metadata corresponding to each test path. Since the user has multiple operation permissions, and for some process nodes, the test needs to be performed in the order of operation permissions. For example, after an ordinary user fills out a form, the administrator user approves the form filled out by the ordinary user, etc., which involves a certain operation sequence. Therefore, it is necessary to obtain the path test sequence according to the page information, and test the test path according to the path test sequence. The test metadata also includes page metadata, model metadata, etc. The test page of the target application is tested based on the page metadata and model metadata.

[0132] In step S435, the target application is tested according to the path test sequence and the test metadata corresponding to each test path to obtain application test data. Specifically, the test paths are tested according to the path test sequence, and the target application is tested according to the page metadata, model metadata, etc. corresponding to the test paths to obtain application test data.

[0133] In some embodiments, Figure 8 As shown, the UI testing process of the target application in the embodiment of the present application is as follows: first, configure the basic test information of the target application, such as the domain name and the currently logged-in user, etc., then analyze and extract the various metadata information of the target application, generate test metadata, and then test the user login situation, specifically, open the default interface of the target application, input and submit the page controls according to the page metadata and model metadata information in the page, analyze the user information and page information in the next path according to the process design metadata, and then switch the user login, obtain the to-do tasks or to-read tasks according to the token, if it is a to-read task, and all are agreed in the first round of testing, if multiple rounds of testing are required, the approval result will be randomly selected later, and the current login user account will be logged out after the test is completed, and it is determined whether all test paths have been executed. If all test paths have not been executed, the next test path will be tested again, and if all test paths have been executed, a test report will be sent. The API testing process for the target application in the embodiment of the present application is as follows: first, configure the basic test information of the target application, such as the domain name and the currently logged-in user, then log in to the test account, obtain information such as the token, obtain the domain model metadata, page design metadata, and process design metadata, and analyze and extract each metadata information, generate test metadata, obtain organizational data, analyze the user information and page information in the next test path based on the process design metadata, then switch the user backend login, obtain the to-do tasks or to-read tasks based on the token, and determine whether all test paths have been executed. If all test paths have not been executed, retest the next test path. If all test paths have been executed, send a test report.

[0134] In an embodiment of the present application, a target application to be tested is obtained, application metadata of the target application to be tested is extracted, the extracted application metadata is processed to obtain test metadata, the target application is tested according to the test metadata, and application test data is obtained. The user only needs to specify the target application to be tested, and the target application can be automatically loaded, and the application metadata of the target application is extracted and analyzed to obtain the test metadata of the target application. The target application is systematically simulated and tested according to the test metadata, and application test data is automatically generated to obtain the test result of the target application, thereby improving the testing efficiency of the application.

[0135] Second, as Fig. 9 As shown, the embodiment of the present application also provides an automatic testing system for an application, including: an acquisition module 100, an extraction module 200, a processing module 300 and a testing module 400, the acquisition module 100 acquires a target application to be tested, the extraction module 200 extracts application metadata of the target application to be tested, the processing module 300 processes the extracted application metadata to obtain test metadata, and the testing module 400 tests the target application according to the test metadata to obtain application test data. The user only needs to specify the target application to be tested, and the system can automatically load the target application, extract and analyze the application metadata of the target application, obtain the test metadata of the target application, perform systematic simulation testing on the target application according to the test metadata, automatically generate application test data, and obtain the test result of the target application, thereby improving the testing efficiency of the application.

[0136] In a third aspect, an embodiment of the present application also provides an electronic device.

[0137] In some embodiments, the electronic device includes: at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions, and the instructions are executed by the at least one processor so that the at least one processor implements the automatic testing method of any application in the embodiments of the present application when executing the instructions.

[0138] The processor and the memory may be connected via a bus or other means.

[0139] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs, such as the automatic testing method for applications described in the embodiments of the present application. The processor implements the automatic testing method for applications described above by running the non-transitory software programs and instructions stored in the memory.

[0140] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store an automatic test method for executing the above application. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0141] The non-transient software programs and instructions required to implement the above-mentioned automatic testing method of the application are stored in the memory, and when executed by one or more processors, the automatic testing method of the application mentioned in the above-mentioned first aspect embodiment is executed.

[0142] In a fourth aspect, embodiments of the present application also provide a computer-readable storage medium.

[0143] In some embodiments, a computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the automatic testing method of the application mentioned in the embodiment of the first aspect.

[0144] In some embodiments, the storage medium stores computer executable instructions, which are executed by one or more control processors, for example, by a processor in the above-mentioned electronic device, so that the above-mentioned one or more processors can execute the automatic testing method of the above-mentioned application.

[0145] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0146] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components 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 may be implemented as hardware, or may be 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 a non-transitory medium) and a communication medium (or a 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 technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies 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.

[0147] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the relevant technical field without departing from the purpose of the present application. In addition, the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

Claims

1. Automatic testing methods for applications, It is characterized in that include: Obtain multiple test applications, and obtain domain name information and account information corresponding to each of the test applications; Selecting a target application from the plurality of test applications according to the plurality of domain name information and the plurality of account information; Extracting application metadata of the target application; Processing the application metadata to obtain test metadata; The processing of the application metadata to obtain the test metadata includes: Get the preset metadata parsing rules; Extracting the corresponding application metadata as the test metadata according to the metadata parsing rule; Testing the target application according to the test metadata to obtain application test data; wherein the application test data is used to indicate whether the function of the target application is normal, and the application metadata includes process metadata; The step of testing the target application according to the test metadata to obtain application test data includes: According to the process metadata, obtaining multiple test nodes corresponding to the target application; According to the plurality of test nodes, a plurality of test paths are obtained; Obtaining page information corresponding to each of the test paths; Processing the page information corresponding to each of the test paths to obtain a path test sequence and the test metadata corresponding to each of the test paths; The target application is tested according to the path test sequence and the test metadata corresponding to each of the test paths to obtain the application test data.

2. The automatic testing method for application according to claim 1, It is characterized in that The test metadata includes model metadata and page metadata; wherein the model metadata is used to characterize the domain data of the target application, and the model metadata includes multiple data type metadata; Correspondingly, testing the target application according to the test metadata to obtain application test data includes: Acquire multiple page controls of the target application and a test range corresponding to each of the page controls according to the model metadata and the page metadata; Generate first test data corresponding to each of the page controls within the test range corresponding to each of the page controls; Inputting the first test data corresponding to each of the page controls into each of the page controls to obtain control data corresponding to each of the page controls; Compare the first test data and the control data corresponding to each of the page controls to obtain a plurality of first comparison results; The application test data is obtained according to the plurality of first comparison results.

3. The automatic testing method for application according to claim 1, It is characterized in that The test metadata includes interface metadata; Correspondingly, testing the target application according to the test metadata to obtain application test data includes: Acquire multiple application interfaces of the target application and an interface protocol corresponding to each of the application interfaces according to the interface metadata; Generate second test data corresponding to each of the application interfaces according to the interface protocol of each of the application interfaces; Inputting the second test data corresponding to each of the application interfaces into each of the application interfaces to obtain interface data corresponding to each of the application interfaces; Comparing the second test data corresponding to each of the application interfaces with the interface data to obtain a plurality of second comparison results; Application test data of the target application is obtained according to the plurality of second comparison results.

4. The automatic testing method for application according to claim 1, It is characterized in that The acquiring, according to the process metadata, a plurality of test nodes corresponding to the target application includes: Acquire multiple user accounts corresponding to the target application according to the process metadata; A plurality of test nodes corresponding to the target application in the login state of each of the user accounts are obtained.

5. Automatic testing system for applications, It is characterized in that include: Acquisition module: The acquisition module is used to acquire multiple test applications, and acquire domain name information and account information corresponding to each of the test applications, and select a target application from the multiple test applications according to the multiple domain name information and the multiple account information; Extraction module: The extraction module is used to extract application metadata of the target application; Processing module: the processing module is used to process the application metadata to obtain test metadata; The processing of the application metadata to obtain the test metadata includes: Get the preset metadata parsing rules; Extracting the corresponding application metadata as the test metadata according to the metadata parsing rule; Testing the target application according to the test metadata to obtain application test data; Test module: the test module is used to test the target application according to the test metadata to obtain application test data; wherein the application test data is used to indicate whether the function of the target application is normal, and the application metadata includes process metadata; the test module tests the target application according to the test metadata to obtain application test data, including: According to the process metadata, obtaining multiple test nodes corresponding to the target application; According to the plurality of test nodes, a plurality of test paths are obtained; Obtaining page information corresponding to each of the test paths; Processing the page information corresponding to each of the test paths to obtain a path test sequence and the test metadata corresponding to each of the test paths; The target application is tested according to the path test sequence and the test metadata corresponding to each of the test paths to obtain the application test data.

6. Electronic equipment, It is characterized in that include: at least one processor, and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions, and the instructions are executed by the at least one processor, so that the at least one processor implements the automatic testing method for the application according to any one of claims 1 to 4 when executing the instructions.

7. Computer readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the automatic testing method for application according to any one of claims 1 to 4.