Automatic testing method and system, electronic equipment and storage medium

By using automated testing methods and leveraging the collaborative work of the testing platform and the server, highly efficient automation of mini-program testing has been achieved, solving the problem of low efficiency in manual testing and improving testing efficiency and convenience.

CN120994538APending Publication Date: 2025-11-21SHENZHEN LEXIN SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510946069.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Current technology relies on manual testing for mini-program testing, resulting in low testing efficiency and a significant time consumption.

Method used

The automated testing method responds to parameter input commands, receives test parameters on the testing platform, sends them to the server for device occupancy detection, assembles test script commands, and performs automated testing on the target device to obtain test results.

Benefits of technology

It improves the efficiency and convenience of mini-program testing, reduces labor costs, and avoids errors caused by devices running different test scripts simultaneously.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994538A_ABST
    Figure CN120994538A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic test method and system, electronic equipment and a storage medium, and the method comprises the steps: responding to a parameter input instruction, receiving a test parameter based on a test platform, and transmitting the test parameter to a server; performing equipment occupation detection processing on the test parameters based on the server to obtain target equipment; performing parameter splicing processing on the test parameters to obtain a test script command; and performing test processing on the applet of the target equipment according to the test script command to obtain a test result. The embodiment of the invention can improve the testing efficiency of the applet, and can be widely applied to the technical field of automatic testing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to an automatic testing method and system, an electronic device and a storage medium. BACKGROUND

[0002] In the related art, there is a manual test applet mode, that is, the applet is tested based on manual issuance of a test instruction, and the test result is checked manually. However, in actual application, it is found that when the applet is tested, the manual test method needs to consume a large amount of time, and a fixed process is used for testing, so that the applet needs to rely on manual test when tested, which affects the test efficiency of the applet.

[0003] Therefore, the technical problems in the related art need to be improved. SUMMARY

[0004] The main purpose of the embodiments of the present application is to provide an automatic testing method and system, an electronic device and a storage medium, which can improve the efficiency of applet testing.

[0005] To achieve the above purpose, one aspect of the embodiments of the present application provides an automatic testing method, which comprises the following steps:

[0006] In response to a parameter input instruction, a test parameter is received based on a test platform, and the test parameter is sent to a server;

[0007] The test parameter is subjected to device occupation detection processing based on the server, and a target device is obtained;

[0008] The test parameter is subjected to parameter splicing processing, and a test script command is obtained;

[0009] The applet of the target device is tested based on the test script command, and a test result is obtained.

[0010] In some embodiments, the test parameter comprises a test name, a mail notifier, a device identifier, a version type and a test script identifier, and the test parameter is received based on the test platform in response to the parameter input instruction, which comprises the following steps:

[0011] A display editing interface is displayed on the test platform, and the editing interface comprises a form area;

[0012] In response to the parameter input instruction, the form area is subjected to parameter editing processing, and the test name and the mail notifier are obtained;

[0013] In response to the parameter input instruction, the form region is subjected to parameter selection processing to obtain the device identifier, the version type and the test script identifier.

[0014] In some embodiments, the device occupation detection processing of the test parameter based on the server side obtains a target device, including the following steps:

[0015] The test parameter is subjected to parameter analysis processing based on the server side to obtain a device identifier.

[0016] The device identifier is subjected to file path checking processing, and when the checking result is that the device corresponding to the device identifier is in an idle state, device connection processing is performed according to the device identifier to obtain the target device.

[0017] In some embodiments, the file path checking processing of the device identifier includes the following steps:

[0018] A lock file directory on the server side is obtained.

[0019] The files under the lock file directory are subjected to name matching processing according to the device identifier, and when a file is matched, the checking result is that the device corresponding to the device identifier is in an occupied state.

[0020] When no file is matched, the checking result is that the device corresponding to the device identifier is in an idle state, and a lock file is generated in the lock file directory according to the device identifier.

[0021] In some embodiments, the test processing of the small program of the target device according to the test script command obtains a test result, including the following steps:

[0022] In response to the test script command, the version type is transparently transmitted to the test script.

[0023] The small program of the target device is subjected to version type selection processing according to the version type through the test script to obtain a target program.

[0024] The target program is subjected to automatic test processing to obtain a test result.

[0025] In some embodiments, the automatic test processing of the target program to obtain a test result specifically includes the following steps:

[0026] The test script is run to generate an interactive instruction.

[0027] The target program is subjected to running test processing according to the interactive instruction to obtain the test result, and the lock file of the target device is deleted.

[0028] In some embodiments, after the test result is obtained, the method further comprises the following steps:

[0029] determining a script description, a running video and a report page according to the test result;

[0030] determining a mail notifier according to the test script command;

[0031] mailing the script description, the running video and the report page to the mail notifier.

[0032] To achieve the above object, another aspect of the embodiments of the present application proposes an automatic test system, which comprises:

[0033] A first module is configured to receive test parameters based on a test platform in response to a parameter input instruction, and send the test parameters to a server;

[0034] A second module is configured to perform device occupation detection processing on the test parameters based on the server to obtain a target device;

[0035] A third module is configured to perform parameter splicing processing on the test parameters to obtain a test script command;

[0036] A fourth module is configured to perform test processing on a small program of the target device according to the test script command to obtain a test result.

[0037] To achieve the above object, another aspect of the embodiments of the present application proposes an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the above method when executing the computer program.

[0038] To achieve the above object, another aspect of the embodiments of the present application proposes a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the above method.

[0039] The embodiments of the present application at least have the following beneficial effects: the present application provides an automatic testing method, system, electronic device and storage medium, the scheme receives test parameters based on the test platform in response to the parameter input instruction, and sends the test parameters to the server, which can receive the test parameters through the test platform to test the applet, reduce the operation difficulty, and improve the convenience of applet testing. In addition, the scheme detects the target device based on the service end to the test parameter, which can avoid the error caused by the simultaneous running of different test scripts. Moreover, the scheme obtains test script commands by splicing the test parameters, and performs applet testing on the target device according to the test script commands to obtain test results, which can perform automatic testing and improve the test efficiency of the applet. BRIEF DESCRIPTION OF DRAWINGS

[0040] Figure 1 is a flowchart of an automatic testing method provided by the embodiments of the present application;

[0041] Figure 2 is an embodiment flowchart provided by the embodiments of the present application;

[0042] Figure 3 is a structural schematic diagram of an automatic testing system provided by the embodiments of the present application;

[0043] Figure 4 is a hardware structure schematic diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical scheme and advantages of the present application clearer, the following will further describe the present application in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application. When the following description relates to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementation described in the following exemplary embodiments does not represent all the implementations consistent with the embodiments of the present application, but is only an example of the system and method consistent with some aspects of the embodiments of the present application as described in the appended claims.

[0045] It can be understood that the terms "first", "second" and the like used in the present application can be used herein to describe various concepts, but unless specifically stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "when" or "in response to determining".

[0046] As used herein, the terms “at least one”, “multiple”, “each”, “any”, or the like, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding plurality, and any refers to any one of the plurality.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing the embodiments of the present application only and is not intended to limit the present application.

[0048] Before the embodiments of the present application are described in detail, first, some nouns and terms involved in the embodiments of the present application are explained, and the nouns and terms involved in the embodiments of the present application are applicable to the following explanations.

[0049] The applet is an application that can be conveniently obtained and spread within WeChat, with excellent user experience. It provides a simple and efficient application development framework and rich components and application programming interfaces (APIs) to help developers develop services with native application program (APP) experience in WeChat.

[0050] In the related art, there is a way of manually testing the applet, that is, testing the applet based on manually issuing test instructions, and checking the test results manually. However, it is found in actual application that when testing the applet, the method of manual testing needs to consume a lot of time, and the test uses a fixed process, which leads to the fact that the applet needs to rely on manual testing when being tested, thereby affecting the test efficiency of the applet.

[0051] Exemplarily, for example, the way of manually testing the applet generally tests the applet through a fixed process. The icon, text, etc. of the applet are operated by sliding or clicking, etc. using a device, so as to test the specific functions of the applet. However, this method needs high labor cost, and the test efficiency of the applet is low.

[0052] Therefore, the application provides an automatic testing method, system, electronic device and storage medium. The method can receive test parameters based on a test platform, and send the test parameters to a server in response to a parameter input instruction. The test parameters can be received by the test platform to test a small program, thereby reducing the operation difficulty and improving the convenience of the small program testing. In addition, the method can detect the test parameters based on the server to obtain a target device, thereby avoiding errors caused by simultaneous running of different test scripts on the device. Furthermore, the method can splice the test parameters to obtain a test script command, and test the target device based on the test script command to obtain a test result, thereby improving the testing efficiency of the small program.

[0053] The automatic testing method provided by the application can be applied to a terminal, a server, or software running in the terminal or the server. In some embodiments, the terminal can be a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, or the like, but is not limited thereto. The server can be configured as a standalone physical server, a server cluster composed of multiple physical servers, or a distributed system, and can also be configured as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, big data, and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application that implements the automatic testing method, but is not limited to the above forms.

[0054] The application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The application can also be practiced in a distributed computing environment in which tasks are performed by remote processing devices connected by a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0055] It should be noted that in various specific embodiments of the present application, when relevant processing needs to be performed on data related to the identity or characteristics of the user, such as user information, user behavior data, user history data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with relevant laws, regulations, and standards. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the user's separate permission or separate consent will be obtained through a pop-up window or a jump to a confirmation page, and after obtaining the user's separate permission or separate consent, the necessary user-related data for the normal operation of the embodiments of the present application will be obtained.

[0056] Figure 1 is an optional flowchart of an automatic testing method provided by an embodiment of the present application, Figure 1 The method in S101-S104 can include but is not limited to the steps.

[0057] S101, in response to a parameter input instruction, receiving a test parameter based on a test platform, and sending the test parameter to a server;

[0058] S102, based on the server, performing device occupation detection processing on the test parameter to obtain a target device;

[0059] S103, performing parameter splicing processing on the test parameter to obtain a test script command;

[0060] S104, performing test processing on the target device according to the test script command to obtain a test result.

[0061] The steps S101-S104 shown in the embodiments of the present application are received by the test platform in response to the parameter input instruction to receive the test parameter, wherein the test platform is used to display a human-computer interaction interface, so that the user can input the relevant test parameters on the test platform and send them to the server, and the server performs automatic testing on the applet according to the input test parameters. The server will perform occupation detection on the device that needs to be tested according to the test parameter, so as to take the idle device as the target device for applet testing. The script command is spliced by the received test parameter, so as to obtain the test script command, and the target device is tested according to the test script command to obtain the final test result.

[0062] One of the above technical solutions has the following advantages or beneficial effects: the embodiment of the application receives test parameters through a test platform, can customize different applet test scripts for automatic testing according to the test parameters, and reduces labor costs. And the target device is tested by the service end running the test script command, which can automatically test the applet and improve the test efficiency.

[0063] In step S101 of some embodiments, the test parameters include a test name, a mail notifier, a device identifier, a version type, and a test script identifier, and the test parameters are received based on the test platform in response to the parameter input instruction, including the following steps:

[0064] The test platform displays an editing interface, and the editing interface includes a form area.

[0065] In response to the parameter input instruction, the test name and the mail notifier are obtained by performing parameter editing processing on the form area.

[0066] In response to the parameter input instruction, the device identifier, the version type, and the test script identifier are obtained by performing parameter selection processing on the form area.

[0067] In the embodiment of the application, the specific automatic testing scheme can be customized on the test platform by displaying the editing interface on the test platform, wherein the editing interface includes a form area for inputting or selecting test parameters. The test parameters can include a test name, a mail notifier, a device identifier, a version type, and a test script identifier, and can also include other data such as a test identification number and a test time. In response to the parameter input instruction, the parameter input instruction can be keyboard input or mouse click, and can also use voice input, which is not limited herein. In the embodiment of the application, the test name is a unique name for identifying the test task, which is used to distinguish different test scenarios or targets, can quickly identify the test purpose, and is convenient for test report classification retrieval and historical record tracking. The mail notifier is a list of email addresses that receive the result notification after the test is completed, which can push the test status notification to relevant personnel for processing problems. The device identifier is the name or identifier of the physical device, virtual machine, or simulator corresponding to the test execution environment, which is used to specify the test running environment and ensure the test coverage of multi-device compatibility. The version type is the version classification of the applet under test, such as the experience version and the formal version, which is used to distinguish the test environment and control the test range. The test script identifier is used to indicate the test script to be tested, wherein the test script is the code implementation of the automatic test case, which is used to simulate user operation or API call and can replace manual execution of repetitive test steps.

[0068] Specifically, the embodiment of the present application responds to the parameter input instruction of the test platform, the parameter input instruction is used for corresponding test parameters, the parameter editing process is performed on the form area in the editing interface displayed by the test platform, the corresponding content is input in the corresponding input box, the test name and the mail notifier are obtained. For example, the test name and the mail notifier are input in the input box of the form area through the keyboard. And the parameter selection process is performed on the form area by the test platform responding to the parameter input instruction, the corresponding device identifier, version type and test script identifier are selected. For example, the corresponding device identifier, version type and test script identifier are selected in the drop-down selection box of the form area through the mouse or touch control.

[0069] One of the above technical solutions has the following advantages or beneficial effects: the embodiment of the present application receives test parameters through the test platform, can input or select corresponding test parameters in response to the parameter input instruction of the test platform, so that the server constructs different test script commands according to different test parameters to perform applet test processing, and improves the flexibility and processing efficiency of automatic test through the test platform.

[0070] In step 102 of some embodiments, the device occupation detection processing is performed on the test parameters based on the server to obtain a target device, including the following steps:

[0071] The device identifier is obtained by performing parameter analysis processing on the test parameters based on the server;

[0072] When the checking result is that the device corresponding to the device identifier is in an idle state, the device connection processing is performed according to the device identifier to obtain the target device.

[0073] In the embodiment of the present application, the server is used to perform applet test according to test parameters. The test parameters include test name, mail notifier, device identifier, version type and test script identifier. The device identifier is an identifier corresponding to the target device to be tested in the test parameters, which is used to uniquely indicate the target device to be tested, and can be composed of letters, numbers and other characters. The target device can be a simulator or a real device.

[0074] Specifically, the test platform packs the test parameters into a test request, performs request listening through the pre-built server, thereby intercepting the test request, performing analysis processing on the test request, thereby obtaining the test parameters, and analyzing the device identifier in the test parameters, thereby obtaining the corresponding device identifier.

[0075] In a feasible embodiment, a corresponding device identifier in the test platform is selected, the device identifier in the test parameter is specifically a corresponding mobile phone model, the test parameter is packaged into a test request, and the test parameter is analyzed by the server to obtain the device identifier, which can be identified as the corresponding mobile phone model. Then, the device identifier is subjected to file path checking processing in the embodiment of the application, and the file path checking is mainly used for checking whether there is a lock file matched with the device identifier, so as to determine whether the device corresponding to the device identifier is occupied according to the lock file. When the checking result is that the device corresponding to the device identifier is in an idle state, the device connection processing can be performed according to the device identifier, and the target device is connected. It can be conceived that when the checking result is that the device corresponding to the device identifier is in an occupied state, the automatic test is stopped and the device is waited until the device is in an idle state and the test is continued, or the automatic test is directly closed, which is not limited herein.

[0076] One of the above technical solutions has the following advantages or beneficial effects: the device identifier is obtained to perform file path checking in the embodiment of the application, so as to determine the state of the target device, avoid errors caused by simultaneous running of different test scripts on the device, and improve the efficiency of the automatic test.

[0077] In some embodiments, the file path checking processing on the device identifier includes the following steps:

[0078] Obtaining a lock file directory on the server;

[0079] Performing name matching processing on the files under the lock file directory according to the device identifier, and when a file is matched, the checking result is that the device corresponding to the device identifier is in an occupied state;

[0080] When no file is matched, the checking result is that the device corresponding to the device identifier is in an idle state, and a lock file is generated in the lock file directory according to the device identifier.

[0081] In the embodiment of the application, the lock file directory is used to save the lock file and can provide a unique access path of the file. The lock file is used to indicate the state of the target device to be tested, and the state of the device identifier can include an idle state and an occupied state, which are used to indicate whether the target device to be tested is in a test state. It should be noted that the file name of the lock file adopts the device identifier of the target device to be tested, and the lock file directory can be subjected to file name matching according to the received device identifier, so as to quickly find the corresponding lock file.

[0082] Specifically, when there is a lock file with the same name as the device identifier, it can be judged that the target device identified by the device identifier is in the test state at this time. In order to avoid the error caused by the device running different test scripts at the same time, the check result is that the device corresponding to the device identifier is in the occupied state. At this time, a queue serial processing task can be introduced, and the current test request is stored in the queue as a to-be-processed task in the submission order, ensuring that the task is executed in the order of submission, avoiding concurrent conflicts, and ensuring the controllability and stability of the system. When no file is matched, it is judged that the target device corresponding to the device identifier is not occupied by other tests at this time, and the check result is that the device corresponding to the device identifier is in the idle state, and a lock file is generated in the lock file directory according to the device identifier. At this time, a lock file with a corresponding name can be generated according to the device identifier, that is, the file name of the lock file is the device identifier, for example, the name of the lock file is the model of a certain mobile phone brand. It should be noted that the embodiments of the application can also use a text file to record the device identifier, and the state of the device can be obtained by querying the text file. However, problems may occur when multiple devices edit and modify the content of the text file at the same time. At the same time, the embodiments of the application can also use a local database to establish a table to store the device identifier, but the database storage requires a high operation cost. The embodiments of the application can create a file or folder with the device identifier for the device running the detection script, delete the folder when the script is completed, and check before running. If the folder exists, it indicates that the device is occupied, and an error is thrown to remind the user.

[0083] One of the above technical solutions has the following advantages or beneficial effects: the embodiments of the application record the state of the target device through the lock file, so that the state of the target device can be judged according to the lock file, and errors caused by the device running different test scripts at the same time are avoided. At the same time, the lock file is used for occupation detection, and the device occupation detection can be performed through simple file creation and file same name judgment, reducing the operation cost and running risk of automatic test.

[0084] In step S103 of some embodiments, the test parameters are parameter spliced to obtain a test script command.

[0085] In the embodiments of the present application, the test parameters include a test name, a mail notifier, a device identifier, a version type, and a test script. Specifically, the test name, the mail notifier, the device identifier, the version type, and the test script identifier can be obtained by performing parameter parsing on the test parameters, and then the parsed parameters are processed by string concatenation to obtain the test script command. In some embodiments, the parameters are processed by parameter parsing to handle spaces and quotation marks, and then the string connection can be directly performed, or the string can be spliced according to the pre-defined splicing rule. For example, the test script command obtained by string concatenation of the test parameters is: let (device identifier) mobile phone run (test script identifier) script, go to test (version type) version applet, and test result mail notification (mail notifier) user. It is conceivable that the special characters or spaces in the test parameters can be detected and deleted to obtain the spliced test script command. For example, the mail notifier can contain special characters, which cannot be recognized by the system when spliced as a command, so the special characters need to be detected and deleted.

[0086] In step S104 of some embodiments, the test script command is used to test the applet of the target device to obtain a test result, including the following steps:

[0087] The version type is transparently transmitted to the test script in response to the test script command.

[0088] The target program is obtained by performing version type selection processing on the applet of the target device according to the version type through the test script.

[0089] The target program is automatically tested to obtain a test result.

[0090] In the embodiments of the present application, the test script command is a script command obtained by splicing the test parameters. The test script command can transparently transmit the version type in the test parameters to the test script. The version type and the test script can be obtained through the test parameters. The version type is transparently transmitted to the test script through the test script command. At this time, the target device runs the test script for automatic testing. The corresponding applet can be selected according to the version type in the test script to obtain the target program that needs to be automatically tested. The target program can be automatically tested according to the test script to obtain a test result. The transparent transmission of the version type to the test script refers to a technology of directly and losslessly transmitting externally received parameters to a target script or command, which can avoid manual parsing of each parameter and improve flexibility and maintainability.

[0091] One of the above technical solutions has the following advantages or beneficial effects: the embodiments of the application can perform automatic compatibility testing on the same applet on various device models and operating system versions, can automatically generate regression test schemes for new functions and update iterations of the applet, cover core business processes, and improve the automatic testing efficiency of the applet.

[0092] In some embodiments, the automatic testing process of the target program to obtain a test result specifically includes the following steps:

[0093] Running the test script to generate an interaction instruction;

[0094] According to the interaction instruction, the target program is run for testing processing to obtain the test result, and the lock file of the target device is deleted.

[0095] In the embodiments of the application, the test script is used for automatic testing of the applet, the interaction instruction is generated through the test script, the interaction instruction can include a click instruction, a sliding instruction and other human-computer interaction instructions, the interaction operation of the user on the target device is simulated through the test script, and the applet is tested accordingly. For example, the applet is opened, the applet page is browsed through the sliding instruction, the function of the applet is detected through the click instruction, such as refreshing the applet page by clicking the refresh button, and the automatic testing of the applet can be realized through different test scripts. Finally, the test result is generated according to the test script, the operation and response in the test process are recorded, and the lock file corresponding to the target device is deleted after the detection is completed.

[0096] One of the above technical solutions has the following advantages or beneficial effects: the embodiments of the application can develop stable and efficient automatic test scripts for the core processes of the applet, such as login, payment, data submission and other functions, simulate testing through the test script to generate interaction instructions, and improve the test efficiency of the applet.

[0097] In some embodiments, after the test result is obtained, the method further includes the following steps:

[0098] According to the test result, a script description, a running video and a report page are determined;

[0099] According to the test script command, a mail notifier is determined;

[0100] The script description, the running video and the report page are notified to the mail notifier by mail.

[0101] One of the above technical solutions has the following advantages or beneficial effects: in the test process, the embodiment of the application records problems through logs, screenshots, screen recordings and the like, generates intuitive and clear feedback reports, and can support multi-dimensional display of test results, such as error rate, success rate, performance data and the like. The embodiment of the application can automatically notify the developer, such as through messages, emails or in-platform reminders, to shorten the feedback link and improve repair efficiency.

[0102] In the embodiment of the application, the test result can include a script description, a running video and a report page, wherein the script description is used to describe the name, test content and state of the test script. The running video is used to record the complete video of the function test of the target program in the automatic test process, and the report page is used to describe each test step and result in the test script. According to the test script command, a mail notifier can be obtained. The test script command is used to send a mail to the server, and the server packs the script description, the running video and the report page and sends them to the mail notifier by mail.

[0103] Next, the scheme of the embodiment of the application will be described and explained in detail in combination with a specific application example:

[0104] Please refer to Figure 2 The embodiment of the application can be applied to the field of automatic testing technology and is suitable for automatic testing scenarios of small programs or application programs. The embodiment of the application takes an example of testing a small program order once every half an hour: a small program order script is pre-recorded, a test task is created on a test platform in response to a parameter input instruction, and a test script command is obtained by receiving and sending test parameters to the server and processing the test parameters. After the developer iterates the corresponding requirements, the regression main test process can be created to create an order test task on the test platform, receive the corresponding test parameters and return them to the server for automatic testing to obtain test results, and the test results will notify the corresponding mail recipient. Specifically, if the test script fails, the mail recipient is reminded by sending an email, and the email content has specific running details and videos, which facilitates error checking and saves development and testing process time and multi-model compatibility time.

[0105] Please refer to Figure 3 The embodiment of the application also provides an automatic testing system, which can implement the above automatic testing method. The system comprises:

[0106] The first module 301 is configured to receive test parameters based on the test platform in response to a parameter input instruction, and send the test parameters to the server;

[0107] The second module 302 is configured to perform device occupancy detection on the test parameter based on the server to obtain a target device.

[0108] The third module 303 is configured to perform parameter splicing on the test parameter to obtain a test script command.

[0109] The fourth module 304 is configured to perform test processing on a small program of the target device according to the test script command to obtain a test result.

[0110] It can be understood that the content in the above method embodiments is applicable to the present system embodiments, the present system embodiments specifically implement the same functions as the above method embodiments, and achieve the same beneficial effects as the above method embodiments.

[0111] The present application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above automatic test method when executing the computer program. The electronic device can be any intelligent terminal, such as a tablet computer or a vehicle-mounted computer.

[0112] It can be understood that the content in the above method embodiments is applicable to the present device embodiments, the present device embodiments specifically implement the same functions as the above method embodiments, and achieve the same beneficial effects as the above method embodiments.

[0113] Please refer to Figure 4 , Figure 4 The hardware structure of the electronic device of another embodiment is illustrated, which includes:

[0114] The processor 401 can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, and is used to execute related programs to implement the technical solutions provided by the present application;

[0115] The memory 402 can be implemented in the form of a ROM (Read Only Memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory). The memory 402 can store an operating system and other application programs. When the technical solutions provided by the present application are implemented by software or firmware, the related program codes are stored in the memory 402 and are called and executed by the processor 401 to implement the automatic test method of the present application.

[0116] The input / output interface 403 is configured to realize information input and output.

[0117] The communication interface 404 is configured to realize communication interaction between the device and other devices, and the communication can be realized through a wired manner (for example, a USB, a network cable and the like) or a wireless manner (for example, a mobile network, WIFI, Bluetooth and the like).

[0118] The bus 405 is configured to transmit information between various components (for example, the processor 401, the memory 402, the input / output interface 403 and the communication interface 404) of the device.

[0119] The processor 401, the memory 402, the input / output interface 403 and the communication interface 404 are connected to each other through the bus 405 to realize communication connection between the device.

[0120] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the automatic test method.

[0121] It can be understood that the contents in the method embodiments are all applicable to the storage medium embodiment, the storage medium embodiment specifically realizes the functions of the method embodiments, and the beneficial effects achieved by the storage medium embodiment are the same as the beneficial effects achieved by the method embodiments.

[0122] The memory is a non-transitory computer readable storage medium, and can be used to store a non-transitory software program and a non-transitory computer executable program. In addition, the memory can include a high-speed random access memory, and can further include a non-transitory memory, for example, at least one magnetic disk storage device, a flash memory device or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and the remote memory can be connected to the processor through a network. Examples of the network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0123] The application embodiment provides an automatic testing method and system, an electronic device and a storage medium. The method comprises the following steps: receiving a test parameter based on a test platform in response to a parameter input instruction; and sending the test parameter to a server. The test parameter is received by the test platform to test a small program, so as to reduce the operation difficulty and improve the convenience of the small program testing. In addition, the device occupation detection processing is performed on the test parameter based on the server to obtain a target device, so as to avoid the error caused by the simultaneous running of different test scripts in the device. Furthermore, the script command splicing processing is performed on the test parameter to obtain a test script command; and the small program testing processing is performed on the target device according to the test script command to obtain a test result, so as to perform the automatic testing and improve the testing efficiency of the small program.

[0124] The embodiments described in the application embodiments are used to more clearly illustrate the technical solutions of the application embodiments, and do not constitute a limitation on the technical solutions provided by the application embodiments. It can be understood by those skilled in the art that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the application embodiments are also applicable to similar technical problems.

[0125] It can be understood by those skilled in the art that the technical solutions shown in the figures do not constitute a limitation on the application embodiments, and can include more or fewer steps than the figures, or combine certain steps or different steps.

[0126] The system embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, that is, can be located in one place or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments.

[0127] It can be understood by those skilled in the art that all or some steps in the above method, the functions of the modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.

[0128] The terms "first", "second", "third", "fourth", and the like in the description and in the claims of this application, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so termed is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of orderly or chronological mundane operation, reverse order operation, based on circuitry availability, based on stated preference or the like, and that "default" or other orderings are thus permissible. Further, the terms "comprise", "comprising", "include", "including", and the like, are specifically intended to be open-ended. That is, references to individual steps and the like do not suhstantially exclude the presence of two or more of a recited step or its integral sub-steps or additional steps whether or not readily ascertainable from the description or the like. Further, the words "a" or "an", as used herein in the disclosure and elsewhere, are used indiscriminately and are to be interpreted in the same way, i.e. as meaning "one or more".

[0129] It should be understood that, in this application, "at least one" means one or more, "multiple" means two or more. "And / or", used to describe the relationship between associated objects, means that there can be three relationships, for example, "A and / or B" can mean: only A, only B, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or the like means any combination of these items, including single or multiple combinations. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0130] In several embodiments provided in the present application, it should be understood that the disclosed system and method can be implemented in other ways. For example, the above-described system embodiments are only illustrative, for example, the division of the above-mentioned units is only a logical functional division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be through some interface, indirect coupling or communication connection between systems or units, which can be electrical, mechanical or other forms.

[0131] The units described above as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0132] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0133] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in part, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes multiple instructions used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various other media that can store programs.

[0134] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, and are not limited to the scope of the embodiments of the present application. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the embodiments of the present application.

Claims

1. An automated testing method, characterized in that, The method includes the following steps: In response to the parameter input command, the test parameters are received by the test platform and sent to the server. Based on the server-side processing of the test parameters, device occupancy detection is performed to obtain the target device; The test parameters are concatenated to obtain the test script commands; The test script commands are used to test the mini-program on the target device, and the test results are obtained.

2. The method according to claim 1, characterized in that, The test parameters include test name, email notify recipient, device identifier, version type, and test script identifier. The process of responding to parameter input instructions and receiving the test parameters from the test platform includes the following steps: The testing platform displays an editing interface, which includes a form area. In response to the parameter input instruction, the form area is edited to obtain the test name and the email notification recipient; In response to the parameter input instruction, parameter selection is performed on the form area to obtain the device identifier, the version type, and the test script identifier.

3. The method according to claim 1, characterized in that, The process of detecting device occupancy based on the test parameters obtained by the server to determine the target device includes the following steps: Based on the server's parameter parsing processing of the test parameters, the device identifier is obtained; A file path check is performed on the device identifier. When the check result indicates that the device corresponding to the device identifier is in an idle state, a device connection process is performed based on the device identifier to obtain the target device.

4. The method according to claim 3, characterized in that, The process of checking the file path of the device identifier includes the following steps: Get the lock file directory on the server; The file names in the lock file directory are matched according to the device identifier. When a file is matched, the result is that the device corresponding to the device identifier is in an occupied state. If no file is matched, the check result indicates that the device corresponding to the device identifier is in an idle state, and a lock file is generated in the lock file directory based on the device identifier.

5. The method according to claim 1, characterized in that, The process of testing the mini-program on the target device according to the test script commands to obtain test results includes the following steps: In response to the test script command, the version type is passed through to the test script; The test script selects the version type of the mini-program on the target device according to the version type to obtain the target program. The target program is subjected to automated testing to obtain test results.

6. The method according to claim 5, characterized in that, The automated testing of the target program to obtain test results specifically includes the following steps: Run the test script to generate interactive instructions; The target program is run and tested according to the interactive instructions to obtain the test results, and the lock file of the target device is deleted.

7. The method according to any one of claims 1 to 6, characterized in that, After obtaining the test results, the method further includes the following steps: Based on the test results, determine the script description, runtime video, and report page; The email notification recipient is determined based on the test script commands. The script description, running video, and report page will be sent to the email sender.

8. An automated testing system, characterized in that, The system includes: The first module is used to respond to parameter input instructions, receive test parameters based on the test platform, and send the test parameters to the server. The second module is used to perform device occupancy detection processing on the test parameters based on the server to obtain the target device; The third module is used to perform parameter concatenation processing on the test parameters to obtain test script commands; The fourth module is used to perform test processing on the applet of the target device according to the test script commands and obtain test results.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.