Test method and device and electronic equipment

By automatically obtaining and displaying test script data in the test case directory, the problems of low accuracy and low efficiency caused by manual input of test cases in the prior art are solved, and efficient and accurate test process automation is achieved.

CN120256301APending Publication Date: 2025-07-04VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510330960.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

Before the new functional module was launched, the existing technology needed to manually input a large number of test cases, resulting in low test accuracy and inefficiency, especially in high-complex functional modules with severe interference.

Method used

By receiving test commands, obtaining the test case directory, automatically executing and displaying the test data of the test script, using Python, Tmux tools and expect scripts to automate the test process, supporting visualization of the test interface and automated inspection of results, reducing manual interaction.

Benefits of technology

It simplifies the test complexity, reduces interference from artificial subjective factors, improves test accuracy and efficiency, and realizes automated multi-terminal interaction testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256301A_ABST
    Figure CN120256301A_ABST
Patent Text Reader

Abstract

The invention discloses a test method and device and electronic equipment, and belongs to the technical field of the electronic equipment, the method comprises the steps that under the condition that a test command is received, a test case directory corresponding to the test command is obtained, the test case directory comprises N sub-directories, each sub-directory comprises M test scripts, and N and M are integers larger than or equal to 1; executing a test operation according to the test case directory; wherein under the condition that the test script of one sub-directory is operated, the test data of the test script of the sub-directory is displayed in the display window corresponding to the sub-directory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of electronic devices, and particularly relates to a testing method, apparatus, and electronic device. Background Art

[0002] With the rapid development of Internet technology, many new functional modules will be developed to provide various service functions for users. Before a new functional module is launched, it is necessary to write test cases for different scenarios and a test program for running the test cases to comprehensively test it and ensure the quality of the new function.

[0003] In the related art, testers need to manually input test cases. However, when there are many test cases and the human-computer interaction scenario of the tester is involved, the tester will manually input a large number of test cases, and due to the interference of human subjective factors, the test accuracy is relatively low. Summary of the Invention

[0004] The purpose of the embodiments of this application is to provide a testing method, apparatus, electronic device, and storage medium, which can reduce manual participation and improve test accuracy.

[0005] In a first aspect, the embodiments of this application provide a testing method, including:

[0006] When receiving a test command, obtaining a test case directory corresponding to the test command, the test case directory includes N subdirectories, and each subdirectory includes M test scripts, where N and M are integers greater than or equal to 1;

[0007] Performing a test operation according to the test case directory; wherein, when running the test script of one of the subdirectories, the test data of the test script of the subdirectory is displayed in the display window corresponding to the subdirectory.

[0008] In a second aspect, the embodiments of this application provide a testing apparatus, which includes:

[0009] An obtaining module, configured to obtain a test case directory corresponding to the test command when receiving the test command, the test case directory includes N subdirectories, and each subdirectory includes M test scripts, where N and M are integers greater than or equal to 1;

[0010] An execution module, configured to perform a test operation according to the test case directory; wherein, when running the test script of one of the subdirectories, the test data of the test script of the subdirectory is displayed in the display window corresponding to the subdirectory.

[0011] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the testing method shown in the first aspect are implemented.

[0012] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the testing method shown in the first aspect are implemented.

[0013] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a display interface. The display interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the testing method shown in the first aspect.

[0014] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the testing method shown in the first aspect.

[0015] In an embodiment of the present application, when a test command is received, a test case directory corresponding to the test command is obtained. The test case directory includes N subdirectories, and each subdirectory includes M test scripts. A test operation is performed according to the test case directory. Among them, when a test script of one of the subdirectories is run, the test data of the test script of the subdirectory is displayed in the display window corresponding to the subdirectory. In this way, by obtaining the test case directory, the test cases corresponding to the test command can be summarized, and it is not necessary for the tester to input the test cases corresponding to the test command one by one. Moreover, by displaying the test data of each test script in the subdirectory in the display window corresponding to the subdirectory, it is convenient for the user to view the test data of each test script running. Therefore, the interference of human subjective factors is reduced, and the test accuracy is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a structural diagram of a testing system provided by some embodiments of the present application;

[0017] Figure 2 It is a flowchart of a testing method provided by some embodiments of the present application;

[0018] Figure 3 It is a schematic diagram of a test case directory of a testing method provided by some embodiments of the present application;

[0019] Figure 4 It is a schematic diagram of a subdirectory of a testing method provided by some embodiments of the present application;

[0020] Figure 5Schematic diagram of the interface of the display window of the test method provided by some embodiments of the present application;

[0021] Figure 6 Schematic diagram of the structure of the test device provided by some embodiments of the present application;

[0022] Figure 7 Schematic diagram of the structure of the electronic device provided by some embodiments of the present application;

[0023] Figure 8 Schematic diagram of the hardware structure of the electronic device provided by some embodiments of the present application. Detailed implementation manners

[0024] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, rather than all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.

[0025] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order different from those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means an "or" relationship between the associated objects before and after.

[0026] With the rapid development of Internet technology, many new functional modules will be developed to provide various service functions for users. Before the new functional module is launched, it is necessary to write test cases for different scenarios and test programs for running the test cases to comprehensively test it and ensure the quality of the new function.

[0027] For example, a network function A is developed for the network function of an electronic device. At this time, in order to achieve compatibility between network function A and the original network function of the electronic device and ensure the normal operation of network function A and the original network function, test cases for different scenarios can be written for its network function A. For example, a test case for initiating a network link is written, the purpose of which is to immediately disconnect the link when the electronic device establishes a link with other device networks through network function A, check whether the network status of both devices are consistent, and whether they can be connected normally next time; or, a test case for testing whether the network function is normal is written, the purpose of which is to test whether the network of the electronic device is normal when switching to network function A when the network of the electronic device is communicating normally, for example, after switching to network function A when sending a communication message to other electronic devices, whether the feedback message of the communication message can be received normally to determine whether the network connection is still normal; or, a test case for testing packet loss is written, the purpose of which is to check whether there is packet loss when switching frequently between the original network function and network function A in the electronic device.

[0028] In the related technology, due to the high complexity of most current functional modules, under the premise of ensuring the quality of new functions, it is necessary to conduct full coverage testing of application functions. Testers need to manually input test cases, wait for the test program to run, and manually check whether the test program running results meet the test requirements. However, when there are many test cases and test human-computer interaction scenarios, testers will manually input a large number of test cases and check whether a large number of running results meet expectations. Moreover, after the module function is changed, it is often necessary to repeatedly execute related test cases. This not only takes a lot of time for testers, but also increases the test complexity of testers in the test scenario. In addition, due to interference from human subjective factors, the test efficiency and accuracy are reduced.

[0029] In order to solve the problems in the above-mentioned related technologies, the embodiments of the present application provide a testing method, device and electronic device. Figures 1 to 8 , the test system, method, device and electronic equipment provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.

[0030] Figure 1 A schematic diagram of the structure of a test system provided for some embodiments of the present application.

[0031] like Figure 1As shown in the figure, the test system provided by the embodiments of the present application may include a service programming module 10 and a test interaction suite 20. In the embodiments of the present application, the communication method between the service programming module 10 and the test interaction suite 20 may adopt the Client-Server (C / S) communication method. Based on this, the service programming module 10 may be set on the server side, and the test interaction suite 20 may be set on the client side, which is a part of the socket communication. Among them, the test interaction suite 20 is used to obtain data and transmit it to the service programming module 10. The service programming module 10 is used to process the data sent by the test interaction suite 20 and feedback the data processing result to the test interaction suite 20.

[0032] Among them, the main task refers to the main task in the test program. In the embodiments of the present application, it refers to managing the timing synchronization between subdirectories, managing the creation of each display window, and the execution order of M subdirectories. The subtask is a part of the main task. There is a subordinate relationship between the subtask and the main task. Multiple subtasks cooperate with each other to complete a complete main task. In the embodiments of the present application, it is to complete a test case directory and separate multiple test tasks for executing N subdirectories. When the subtask starts to run, it can be bound to the main task to achieve synchronous communication between the application program running module and the program controller, so as to synchronize the test status between each subdirectory and the test script. In the embodiments of the present application, the test case refers to the description of the test task for the application program, that is, the test plan, method, technology and strategy.

[0033] Among them, the service programming module 10 may include a Program Controller 101, an Env Operation 102, a Tmux sender 103, and a SynchronousProcessor 104.

[0034] The test interaction suite 20 may include a program running 201, an Inter-Process Communication (IPC) 202, a Synchronous (SYNC) 203, and a Test monitor 204. Further, the Test monitor 204 may specifically include a detector and a Test input.

[0035] Here, the test system in the embodiments of the present application can be implemented through Python, Tmux tools, and expect scripts, which can automate the test process, support the visualization of the test interface, and the automated inspection of test results. Among them, Python is a programming language used to provide standard libraries, relying on Python for data processing and graphical interface development during the test process. The Tmux tool is an electronic device multiplexer, which is a type of development tool. It supports arbitrary vertical or horizontal splitting of the display interface on the electronic device. It can be understood as a management tool for the display interface of the electronic device, which can merge and split the display interface, etc. The Expect script is an existing automated test interaction suite. Expect contains pattern matching using regular expressions and general programming functions, providing the ability to input characters for program interaction, and then using regular expressions to match the results to complete the verification of test results.

[0036] Based on this, the above-mentioned related objects will be described in detail below.

[0037] The program controller 101 is used to implement the parsing of test programs and Python test scripts under the test case directory structure through Python scripts, and test relevant test cases in the test order.

[0038] The initialization processor 102 is used for the initialization of the test scenario and the reset of the test scenario after the completion of the operation of each test case directory.

[0039] The graphics controller 103 is used to control each display window through the Tmux tool.

[0040] The synchronization processor 104 is used for the management of resource synchronization between test scripts in N subdirectories in the test case directory, the execution order of different test tasks, and ensuring the timing of subdirectory operation.

[0041] The application program running module 201 is used to run the test programs in the test case directory.

[0042] The inter-process communication module 202 is used for information interaction between different subdirectories in the test case directory.

[0043] The synchronization processing module 203 is used to provide an application release interface for synchronizing resources between each subdirectory.

[0044] The test monitor 204 is used to check the execution expectations of the test program and automatically input test commands.

[0045] Based on the above test system, the embodiments of the present application provide a test method that can be applied to the test system, which is specifically as follows.

[0046] Figure 2Flowchart of the test method provided for some embodiments of the present application.

[0047] As Figure 2 shown, the test method provided by the embodiments of the present application can be applied to a test system. The test method may include steps 210 to 230, which are specifically as follows.

[0048] Step 210, when a test command is received, obtain a test case directory corresponding to the test command. The test case directory includes N subdirectories, and each subdirectory includes M test scripts. N and M are integers greater than or equal to 1. Step 220, perform a test operation according to the test case directory. Wherein, when running the test script of one of the subdirectories, display the test data of the test script of the subdirectory in the display window corresponding to the subdirectory.

[0049] Exemplarily, receive a test command such as "python3 xxx.py" input by the user through the test interaction suite 20 or receive a first input for the user to click to start the test, and transmit the test command to the service programming module 10. Determine the test case directory corresponding to "python3 xxx.py" through the service programming module 10. For details, refer to Figure 3 , the test case directory includes 4 subdirectories, that is, N is 4. Specifically, subdirectory 1 "it_cancel", subdirectory 2 "it_create_cancel", subdirectory 3 "it_create_cancel2", and subdirectory 4 "it_rollback_test". Taking subdirectory 1 "it_cancel" as an example, as Figure 4 shown, this subdirectory includes 3 test scripts, namely test1, test2, and test3. Here, it should be noted that the data of the test scripts in each subdirectory can be the same or different. The number of test scripts in the subdirectory is not limited herein. Then, run the 3 test scripts in the subdirectory. As Figure 5 shown, three sub-windows can be divided in the display window 50 corresponding to subdirectory 1 "it_cancel", namely sub-window 501, sub-window 502, and sub-window 503. Among them, sub-window 501 is used to display the test data of test1, sub-window 502 is used to display the test data of test2, and sub-window 503 is used to display the test data of test3.

[0050] Thus, by obtaining the test case directory, the test cases corresponding to the test commands can be summarized, eliminating the need for testers to input the test cases corresponding to the test commands one by one. Moreover, the test data of each test script in the subdirectory is displayed through the display window corresponding to the subdirectory, facilitating users to view the test data of each test script during operation. As a result, the test complexity can be simplified, the interference of human subjective factors can be reduced, and the test efficiency and accuracy can be improved.

[0051] The above steps will be described in detail as follows.

[0052] First, regarding step 210, in some embodiments of the present application, the test commands in the embodiments of the present application can be determined by user input or by the user selecting a certain test command from multiple test commands. For example, the user can input the test command "python3 xxx.py" or click on the target test command "python3 xxx.py" among at least one test command.

[0053] Based on this, when a test command is received, the main process starts running and parses the test case directory corresponding to the test command. As shown, if N is an integer greater than 1, the running order of the N subdirectories is determined according to the order of the directory names of the N subdirectories. Exemplarily, as shown, the order of the directory names of the 4 subdirectories can be: the first subdirectory 1 "it_cancel", the second subdirectory 2 "it_create_cancel", the third subdirectory 3 "it_create_cancel2", and the fourth subdirectory 4 "it_rollback_test". Figure 3 Shown as follows, if N is an integer greater than 1, the running order of the N subdirectories is determined according to the order of the directory names of the N subdirectories. Exemplarily, as Figure 3 shown, the order of the directory names of 4 subdirectories can be: the first subdirectory 1 "it_cancel", the second subdirectory 2 "it_create_cancel", the third subdirectory 3 "it_create_cancel2", and the fourth subdirectory 4 "it_rollback_test".

[0054] Specifically, in the embodiments of the present application, the N subdirectories can be sorted in ascending order according to the directory names of the N subdirectories, thereby ensuring that the order of the N subdirectories is the execution order of the subdirectories.

[0055] Furthermore, for each of the above subdirectories, the subdirectory can include M test scripts. Taking the first subdirectory 1 "it_cancel" as an example, the first subdirectory 1 "it_cancel" can include 3 test scripts, namely test1, test2, and test3. Here, in the embodiments of the present application, a display window corresponding to each subdirectory is created through the Tmux script tool. The display window can include M sub-windows, with one test script corresponding to one sub-window, and the sub-window is used to display the test data of the test script.

[0056] It should be noted that the test case directory in the embodiments of the present application is used to store the directory path of test cases. One subdirectory represents one test case. There will be as many subdirectories as there are test cases. If new test cases are added, subdirectories can be increased.

[0057] It should be noted that the test cases in the embodiments of the present application refer to test strategies constructed based on test scenarios, which may include test objectives, test environments, test inputs, test steps, test methods, expected results, etc. The test script is a series of test instructions designed for the test program that runs the test cases, and in the embodiments of the present application, it can be an instruction file for testing in the order written according to the test cases.

[0058] Next, referring to step 220, in some embodiments of the present application, when N is an integer greater than 1 and the N subdirectories need to be executed in sequence, step 220 can be implemented through the following steps 2201 to 2204. That is, the test data includes test result data. Based on this, step 220 can specifically include steps 2201 to 2204.

[0059] Step 2201, determine the i-th subdirectory from the N subdirectories through the service programming module.

[0060] Exemplarily, still taking N as 4 for illustration, the 4 subdirectories can be executed in sequence. At this time, determine the first subdirectory 1 "it_cancel" from the 4 subdirectories through the service programming module.

[0061] Step 2202, run the M test scripts in the i-th subdirectory through the test interaction suite, and transmit the test result data of each test script in the i-th subdirectory to the service programming module.

[0062] Exemplarily, through the test interaction suite, three test scripts in the first sub-directory 1 "it_cancel", namely test1, test2, and test3, are run. If the three test scripts do not need to be executed in a sequential order, they can be executed synchronously or asynchronously. After the run is completed, the test result data of the test scripts is synchronized to the service programming module. For example, if test1 finishes running first, the test result data of test1 is synchronized to the service programming module. Then, when test2 finishes running, the test result data of test2 can be synchronized to the service programming module. Or, if the three test scripts need to be executed in a sequential order, such as executing test1, test2, and test3 in sequence, when test1 finishes running first, the test result data of test1 can be synchronized to the service programming module, then continue to execute test2, and when test2 finishes running, the test result data of test2 is synchronized to the service programming module. Then, continue to execute test3, and when test3 finishes running, the test result data of test2 is synchronized to the service programming module.

[0063] It should be noted that to save test resources, running the test scripts can be to select a main test script from multiple test scripts. After the main test script is executed, it represents that the sub-directory execution is completed. Exemplarily, let test1 be the default main test script, and test2 and test3 are used to test the corresponding test scenarios, but the control flow still lies with test1. In the case where test1 is executed, it is defaulted that test2 and test3 are also executed, and the test result of test1 is synchronized to the service programming module as the test result data of the entire sub-directory 1.

[0064] Step 2203, in the case where the service programming module obtains the test result data of each test script in the i-th sub-directory, determine the (i + 1)-th sub-directory from N sub-directories through the service programming module.

[0065] Exemplarily, determine the second sub-directory 2 "it_create_cancel" from four sub-directories through the service programming module.

[0066] Step 2204, run M test scripts in the (i + 1)-th sub-directory through the test interaction suite.

[0067] Exemplarily, by means of the test interaction suite, two test scripts, namely test1 and test2, in the second sub-directory 2 "it_create_cancel" are run. If the two test scripts do not need to be executed in a sequential order, they can be executed synchronously or asynchronously. After the run is completed, the test result data of the test scripts is synchronized to the service programming module. For example, if test1 finishes running first, the test result data of test1 is synchronized to the service programming module. Then, when test2 finishes running, the test result data of test2 can be synchronized to the service programming module. Or, if the two test scripts need to be executed in a sequential order, for example, when executing test2 and test1 in sequence, the test result data of test2 can be synchronized to the service programming module when test2 finishes running first, and then test1 continues to be executed. When test1 finishes running, the test result data of test1 is synchronized to the service programming module.

[0068] It should be noted that until the value of the (i + 1)-th sub-directory is greater than N, the determination of the sub-directory is stopped by the service programming module. Exemplarily, if i is 3 and the value of its (i + 1)-th sub-directory is 4 which is greater than N = 3, it means that all the test case directories have been tested, and the determination of the sub-directory can be stopped.

[0069] In this way, the service programming module obtains the test result data of each test script in the previous sub-directory. When it is determined that all the tests in the previous sub-directory are completed, the test scripts in the next sub-directory are run through the test interaction suite. Without the need for testers to detect the test results of the previous test script or input the next test case one by one, the testing of the test case directory corresponding to the test command can be completed, which simplifies the testing complexity, reduces the interference of human subjective factors, and improves the testing efficiency and accuracy.

[0070] In some embodiments of the present application, the above step 2201 may specifically include:

[0071] Through the test interaction suite, M test scripts in the i-th sub-directory are run according to the traversal order of the N sub-directories, and the traversal order is determined by the order in which the test interaction suite traverses the sub-directories in the N sub-directories.

[0072] Among them, the sequential order involved in the N sub-directories that need to be executed in sequence can be the order of traversing the sub-directories when obtaining the test command, or the sorting of the directory names of the N sub-directories.

[0073] In some embodiments of the present application, before the steps of running the M test scripts in any sub-directory through the test interaction suite in the above steps 2202, 2204, etc., the following steps of resource request are executed. Based on this, the test method may further include steps 2205 to 2207.

[0074] Step 2205, transmit a resource request to the service programming module through the test interaction suite, where the resource request is used to request the service programming module to feedback the dependent resources for running the M test scripts in the i-th sub-directory.

[0075] Exemplarily, each of the M test scripts in the i-th sub-directory is regarded as a sub-task, that is, there are M sub-tasks. Then, when executing sub-task 1, if it is necessary to wait for sub-task 2 to perform a certain operation before executing sub-task 1, at this time, the resource for sub-task 2 to perform a certain operation required for running sub-task 1 is recorded as the dependent resource. At this time, a resource request can be transmitted to the service programming module through the test interaction suite to request dependent resource A, and sub-task 1 in the M test scripts is paused.

[0076] It should be noted that in the embodiments of the present application, the resource request can be parsed by a synchronization processor, and the format of the resource request can be "identifier of the dependent resource: script name of the i-th test script: resource type". The identifier of the dependent resource is the resource that needs to be applied for or released, the script name of the i-th test script is the sub-script name for applying for or releasing the resource, and the resource manager distributes resource signals to the corresponding tasks through this resource request to achieve synchronization.

[0077] Step 2206, determine whether the first resource set includes the dependent resource through the service programming module. The first resource set includes resources and resource identifiers related to the executed test scripts in at least one test case directory.

[0078] Exemplarily, through the main task in the service programming module, check whether the first resource set Q includes the dependent resource. If the dependent resource is included, the following step 2207 can be executed. On the contrary, if the dependent resource is not included, the following steps 2208 and 2209 can be executed.

[0079] It should be noted that in the embodiments of the present application, the first resource set Q can be created in the service programming module before step 210, and is used to store resources and resource identifiers related to the executed test scripts in the test case directory. The Q set can be implemented using a List linked list to solve the problem of test task synchronization.

[0080] Step 2207, in the case where it is determined that the first resource set includes the dependent resource, remove the identifier of the dependent resource from the first resource set, and transmit the dependent resource to the test interaction suite through the service programming module.

[0081] Exemplarily, if the first resource set Q includes its dependent resources, the identifier of the dependent resource is removed from Q, and the dependent resource is transmitted to the test interaction suite through the service programming module, so that through the test interaction suite, the script of the M test scripts, such as subtask 2, is selected and released based on the dependent resources, and subtask 1 that depends on subtask 2 in the M test scripts is continued to be executed.

[0082] After the above step 2206 , the testing method may further include steps 2208 and 2209 .

[0083] Step 2208: When it is determined that the first resource set does not include the dependent resource, the identifier of the dependent resource is added to the second resource set, and the test script in the i-th subdirectory is suspended through the test interaction suite.

[0084] Step 2209, when the first resource set includes the newly added resource and the newly added resource is a dependent resource, delete the identifier of the dependent resource from the second resource set and remove the identifier of the newly added resource from the first resource set, and transmit the dependent resource to the test interaction suite through the service programming module.

[0085] Exemplarily, if there are no dependent resources in the Q set, the dependent resources are added to the second resource set. When the first resource set includes new resources, that is, when the test case directory has a test script that has been run, the service programming module can be used to search whether there are dependent resources in the P set that match the newly added resources. If so, the service programming module is used to notify the test interaction suite to unblock, so that the test interaction suite can select and release the M test scripts in the i-th subdirectory based on the dependent resources and continue to execute the test scripts in the i-th subdirectory. On the contrary, if there are no dependent resources matching the newly added resources in the P set found by the service programming module, the newly added resources are added to the Q set, and the search can be performed when other subdirectories are requested next time.

[0086] It should be noted that in the embodiment of the present application, the second resource set P can be created in the service programming module before step 210, and is used to store the identifier of the subdirectory related to the resource request transmitted to the service programming module through the test interaction suite in the test case directory. The P set can be implemented using a List linked list to solve the problem of test task synchronization.

[0087] Then, the display windows in the embodiments of the present application can correspond to subdirectories one by one. When displaying, the display windows corresponding to the subdirectories can be allocated in the order of traversing N subdirectories. The display windows can include sub-windows corresponding to the test scripts in the subdirectories one by one, and the process of running each test script can be visualized in its corresponding sub-window. Among them, different subdirectories run in different child processes. One display window corresponds to one subdirectory, that is, the display window is the display interface for the operation of the subdirectory. Tmux can be used to operate each display window or sub-window, and corresponding instructions can be sent through tmux in the main process to the corresponding child process for execution, that is, a command to execute a python script can be sent, so that the task script runs in the corresponding display window.

[0088] In some embodiments of the present application, the test data includes test result data, and the test method may further include step 2401 and step 2402.

[0089] Step 2401, obtain the expected blocking duration of the j-th test script in the subdirectory.

[0090] Exemplarily, the j-th test script can be written in an expect script. In this way, the expected blocking duration of the program output expected value can be set through the expect component, such as 10S.

[0091] Step 2402, in the case that the test result data of the j-th test script is not obtained within the expected blocking duration, stop running the M test scripts in the subdirectory.

[0092] Exemplarily, if the test result data of the j-th test script is not obtained within 10S, stop running the M test scripts in the entire subdirectory and execute the following steps.

[0093] Based on this, step 230 may specifically include:

[0094] In the display window corresponding to the subdirectory, distinguish and display the test data related to the j-th test script.

[0095] Thus, the test scripts without test result data and the test data related to them can be distinguished and displayed through the display window, eliminating the need for testers to check the running results, simplifying the test complexity, reducing the interference of human subjective factors, and improving the test efficiency and accuracy.

[0096] In some embodiments, after step 2402, step 230 may specifically include:

[0097] In the case where the test result data of the j-th test script is obtained within the expected blocking duration, run the test script after the j-th test script in the subdirectory, and display the test data of the test script after the j-th test script in the display window corresponding to the subdirectory.

[0098] Exemplarily, if the test result data of the j-th test script is obtained within 10S, all the test scripts after the j-th test script in the subdirectory can be continued to run, and the test data of all the test scripts after the j-th test script are displayed in the display window corresponding to the subdirectory.

[0099] In addition, the N subdirectories in the embodiments of the present application include an end subdirectory. Based on this, the test method provided by the embodiments of the present application may further include step 2501:

[0100] In the case where the M test scripts in the end subdirectory have finished running, exit the display window and end the test.

[0101] Exemplarily, in all subdirectories, there is a subdirectory that needs to control the end of the test process. This subdirectory is called the end subdirectory. After the end subdirectory is executed, it also means that other subdirectories are executed. At this time, the end subdirectory sends an end instruction to the main task of the service programming module, and the program controller parses the end instruction, then stops running the test scripts in the test case directory and exits the display window related to the test user directory. Then, it is judged whether there are other test case directories that can be executed. If not, the test is exited. Otherwise, steps 220 and 230 are re-executed to complete the test.

[0102] Thus, the test method provided by the embodiments of the present application can use python to realize the automated test of visual interactive testing, and realizes that the program controller and the test monitor only need to write corresponding test scripts according to the test case template, which can solve the problems of tests that require manual interactive input and manual inspection of test cases, realizes the automated multi-terminal interactive test, automates all tests, and improves the test efficiency.

[0103] In order to illustrate in detail the test method provided by the embodiments of the present application, the following is a detailed description in combination with the following steps.

[0104] S60, when the test entry module in the test monitor receives a test command, the program controller obtains the test case directory corresponding to the test command, and the test case directory includes 3 subdirectories.

[0105] S61. For each subdirectory, the graphics controller traverses the number of test scripts in the subdirectory, such as 3, creates a display window for the subdirectory through the Tmux tool, and divides sub-windows corresponding to each test script in the display window, that is, one sub-window corresponds to one test script, and the sub-window is used to display the test data of the test script.

[0106] S62. The initialization processor creates a resource manager, which is used for test synchronization between subdirectories or test scripts, that is, it builds the communication between the test interaction suite and the service programming module, controls the operation of subdirectories and blocks the operation of subdirectories.

[0107] S63. Through the test interaction suite, run the 3 test scripts in the first subdirectory among the 3 subdirectories. The 3 test scripts can be written in expect scripts.

[0108] S64. Through the test interaction suite, transmit a resource request to the service programming module. The resource request is used to request the service programming module to feedback the dependent resources required when running the first test script in the first subdirectory.

[0109] S65. Through the service programming module, determine whether the first resource set includes dependent resources. If it includes, execute S66; if it does not include, execute S67.

[0110] S66. In the case where it is determined that the first resource set includes dependent resources, such as the test data of the second test script, through the service programming module, remove the identifier of the dependent resources from the first resource set, transmit the dependent resources to the test interaction suite through the service programming module, and run the first test script through the application program running module.

[0111] S67. In the case where it is determined that the first resource set does not include dependent resources, through the service programming module, add the identifier of the dependent resources to the second resource set, and pause the operation of the first test script through the test interaction suite, so that after the second test script runs, the first test script can continue to run; in the case where the first resource set includes new resources and the new resources are dependent resources, delete the identifier of the dependent resources from the second resource set and remove the identifier of the new resources from the first resource set, transmit the dependent resources to the test interaction suite through the service programming module, and run the first test script through the application program running module.

[0112] S68. Through the service programming module, obtain the expected blocking duration of the first test script in the first subdirectory, and through the service programming module, determine whether its test result data is output within the expected blocking duration. If it is output, execute S69. If it is not output, execute S610.

[0113] S69, stop running the first sub-directory through the test interaction suite, and in the display window corresponding to the sub-directory, differentially display the test data related to the first test script.

[0114] S610, run each test script in the first sub-directory through the test interaction suite, and display the test data of each test script in the display window corresponding to the sub-directory.

[0115] Thus, the test method provided by the embodiments of the present application can use python to implement automated testing of visual interactive testing, enabling the program controller and test monitor to only write corresponding test scripts according to the test case template, which can solve the problems of manual interactive input testing and manual inspection of test cases, realizing automated multi-terminal interactive testing, automating all tests, and improving the testing efficiency.

[0116] It should be noted that for the test method provided by the embodiments of the present application, the execution subject can be an electronic device such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a wearable device, etc. In some embodiments of the present application, taking an electronic device as the execution subject to execute the test method as an example, the test method provided by the embodiments of the present application is described.

[0117] For the test method provided by the embodiments of the present application, the execution subject can be a test device. In the embodiments of the present application, taking the test device to execute the test method as an example, the device of the test method provided by the embodiments of the present application is described.

[0118] The present application also provides a test device. Specifically, it is described in detail in combination with Figure 6 for elaboration.

[0119] Figure 6 is a schematic structural diagram of the test device provided by some embodiments of the present application.

[0120] As Figure 6 shown, the test device 60 can be applied to an electronic device, and the test device 60 specifically may include:

[0121] An acquisition module 601, configured to obtain a test case directory corresponding to a test command when receiving the test command, where the test case directory includes N sub-directories, and each sub-directory includes M test scripts, and N and M are integers greater than or equal to 1;

[0122] An execution module 602, configured to perform a test operation according to the test case directory; wherein, when running the test script of one of the sub-directories, display the test data of the test script of the sub-directory in the display window corresponding to the sub-directory.

[0123] The test device 60 in the embodiments of the present application will be described in detail below, as shown specifically as follows.

[0124] In some embodiments of the present application, the test device 60 in the embodiments of the present application may further include a determination module, configured to, when N is an integer greater than 1 and the test data includes test result data, determine the i-th subdirectory from N subdirectories through the service programming module;

[0125] An execution module 602, configured to run M test scripts in the i-th subdirectory through the test interaction suite, and transmit the test result data of each test script in the i-th subdirectory to the service programming module;

[0126] The determination module may further be configured to, when the service programming module obtains the test result data of each test script in the i-th subdirectory, determine the (i + 1)-th subdirectory from N subdirectories through the service programming module;

[0127] The execution module 602 is configured to run M test scripts in the (i + 1)-th subdirectory through the test interaction suite.

[0128] In some embodiments of the present application, the running order of the N subdirectories is determined according to the order of the directory names of the N subdirectories.

[0129] In some embodiments of the present application, the execution module 602 may specifically be configured to, when M is an integer greater than 1, run M test scripts in the i-th subdirectory in the traversal order of the N subdirectories through the test interaction suite, and the traversal order is determined by the order in which the test interaction suite traverses the subdirectories in the N subdirectories.

[0130] In some embodiments of the present application, the test device 60 in the embodiments of the present application may further include a transmission module, configured to transmit a resource request to the service programming module through the test interaction suite, where the resource request is used to request the service programming module to feedback the dependent resources for running M test scripts in the i-th subdirectory;

[0131] The test device 60 in the embodiments of the present application may further include a determination module, configured to determine whether the first resource set includes dependent resources through the service programming module, where the first resource set includes resources related to the executed test scripts in the N subdirectories and the identifiers of the resources;

[0132] The test device 60 in the embodiments of the present application may further include a removal module, configured to, when it is determined that the first resource set includes dependent resources, remove the identifiers of the dependent resources from the first resource set, and transmit the dependent resources to the test interaction suite through the service programming module.

[0133] In some embodiments of the present application, the test device 60 in the embodiments of the present application may further include an adding module, configured to add the identifier of the dependent resource to the second resource set and pause the running of the test script in the i-th subdirectory through the test interaction suite when it is determined that the first resource set does not include the dependent resource;

[0134] The test device 60 in the embodiments of the present application may further include a processing module, configured to, when the first resource set includes a newly added resource and the newly added resource is a dependent resource, delete the identifier of the dependent resource from the second resource set and remove the identifier of the newly added resource from the first resource set, and transmit the dependent resource to the test interaction suite through the service programming module.

[0135] In some embodiments of the present application, the obtaining module 601 may specifically be configured to obtain the expected blocking duration of the j-th test script in the subdirectory when the test data includes test result data;

[0136] The execution module 602 may further be configured to stop running the M test scripts in the subdirectory when the test result data of the j-th test script is not obtained within the expected blocking duration. The test device 60 in the embodiments of the present application may further include a display module, configured to differentially display the test data related to the j-th test script in the display window corresponding to the subdirectory.

[0137] In some embodiments of the present application, the execution module 602 may be configured to run the test script after the j-th test script in the subdirectory when the test result data of the j-th test script is obtained within the expected blocking duration;

[0138] The display module 603 may specifically be configured to display the test data of the test script after the j-th test script in the display window corresponding to the subdirectory.

[0139] The test device in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than terminals. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.

[0140] The test device in the embodiments of the present application can be a device with an operating system. The operating system can be the Android operating system, the IOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.

[0141] The test device provided by the embodiments of the present application can implement Figures 1 to 5 each process implemented by the test method embodiments shown, achieving the same technical effects. To avoid repetition, details are not described here again.

[0142] Based on this, the test device provided by the embodiments of the present application, when receiving a test command, obtains a test case directory corresponding to the test command. The test case directory includes N subdirectories, and each subdirectory includes M test scripts; performs a test operation according to the test case directory; wherein, when running the test script of one of the subdirectories, the test data of the test script of the subdirectory is displayed in the display window corresponding to the subdirectory. In this way, by obtaining the test case directory, the test cases corresponding to the test command can be summarized, eliminating the need for testers to input the test cases corresponding to the test command one by one, and by displaying the test data of each test script in the subdirectory in the display window corresponding to the subdirectory, it is convenient for users to view the test data of each test script run. Thus, the interference of human subjective factors is reduced, and the test accuracy is improved.

[0143] Optionally, as Figure 7As shown in the figure, an embodiment of the present application further provides an electronic device 70, including a processor 701 and a memory 702. A program or instruction that can run on the processor 701 is stored on the memory 702. When the program or instruction is executed by the processor 701, each step of the above-mentioned test method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.

[0144] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0145] Figure 8 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.

[0146] The electronic device 800 includes, but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, a processor 810, and other components.

[0147] Those skilled in the art can understand that the electronic device 800 may further include a power source (such as a battery) for supplying power to each component. The power source can be logically connected to the processor 810 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system.

[0148] Figure 8 The structure of the electronic device shown in does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0149] Among them, in an embodiment of the present application, the processor 810 may be used to obtain a test case directory corresponding to a test command when receiving the test command. The test case directory includes N subdirectories, and each subdirectory includes M test scripts. N and M are integers greater than or equal to 1. The processor 810 may also be used to perform a test operation according to the test case directory; wherein, when running the test script of one of the subdirectories, the test data of the test script of the subdirectory is displayed in the display window corresponding to the subdirectory.

[0150] The following is a detailed description of the electronic device 800, which is specifically as follows.

[0151] In some embodiments of the present application, when N is an integer greater than 1 and the test data includes test result data, the processor 810 may be used to determine the i-th subdirectory from the N subdirectories through a service programming module;

[0152] Run the M test scripts in the i-th subdirectory through the test interaction suite, and transmit the test result data of each test script in the i-th subdirectory to the service programming module;

[0153] When the service programming module obtains the test result data of each test script in the i-th subdirectory, determine the (i + 1)-th subdirectory from the N subdirectories through the service programming module;

[0154] Run the M test scripts in the (i + 1)-th subdirectory through the test interaction suite.

[0155] In some embodiments of the present application, the running order of the N subdirectories is determined according to the order of the directory names of the N subdirectories.

[0156] In some embodiments of the present application, the processor 810 can be used to run the M test scripts in the i-th subdirectory in the traversal order of the N subdirectories through the test interaction suite, and the traversal order is determined by the order in which the test interaction suite traverses the subdirectories in the N subdirectories.

[0157] In some embodiments of the present application, the processor 810 can be used to transmit a resource request to the service programming module through the test interaction suite, and the resource request is used to request the service programming module to feedback the dependent resources for running the M test scripts in the i-th subdirectory;

[0158] Determine whether the dependent resources are included in the first resource set through the service programming module, and the first resource set includes the resources and the identifiers of the resources related to the executed test scripts in the N subdirectories;

[0159] When it is determined that the dependent resources are included in the first resource set, remove the identifiers of the dependent resources from the first resource set, and transmit the dependent resources to the test interaction suite through the service programming module.

[0160] In some embodiments of the present application, the processor 810 can be used to, when it is determined that the dependent resources are not included in the first resource set, add the identifiers of the dependent resources to the second resource set, and pause running the M test scripts in the i-th subdirectory through the test interaction suite;

[0161] When the new resources are included in the first resource set and the new resources are dependent resources, delete the identifiers of the dependent resources from the second resource set and remove the identifiers of the new resources from the first resource set, and transmit the dependent resources to the test interaction suite through the service programming module.

[0162] In some embodiments of the present application, the processor 810 can be used to obtain the expected blocking duration of the j-th test script in the subdirectory when the test data includes the test result data.

[0163] The processor 810 can be used to stop running the M test scripts in the sub-directory when the test result data of the j-th test script is not obtained within the expected blocking duration.

[0164] The display unit 806 can specifically be used to differentially display the test data related to the j-th test script in the display window corresponding to the sub-directory.

[0165] In some embodiments of the present application, the processor 810 can be used to run the test script after the j-th test script in the sub-directory when the test result data of the j-th test script is obtained within the expected blocking duration.

[0166] The display unit 806 can specifically be used to display the test data of the test script after the j-th test script in the display window corresponding to the sub-directory.

[0167] It should be understood that the input unit 804 may include a Graphics Processing Unit (GPU) 8041 and a microphone 8042. The graphics processor 8041 processes the image data of static images or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 806 may include a display panel, and the display panel can be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 807 includes at least one of a touch panel 8071 and other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 can include two parts: a touch detection device and a touch display. The other input devices 8072 can include, but are not limited to, a physical keyboard, function keys (such as volume display keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.

[0168] The memory 809 can be used to store software programs and various data. The memory 809 mainly includes a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area can store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 809 can include a volatile memory or a non-volatile memory, or the memory 809 can include both a volatile and a non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 809 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.

[0169] The processor 810 may include one or more processing units; optionally, the processor 810 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless display signals, such as a baseband processor. It can be understood that the above-mentioned modem processor may not be integrated into the processor 810 either.

[0170] The embodiments of the present application also provide a readable storage medium. A program or instructions are stored on the readable storage medium. When the program or instructions are executed by a processor, each process of the above-mentioned test method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.

[0171] Among them, the processor is the processor in the electronic device in the above-mentioned embodiment. Among them, the readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.

[0172] In addition, an embodiment of the present application further provides a chip, which includes a processor and a display interface. The display interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above-mentioned test method embodiment and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0173] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.

[0174] The embodiment of the present application provides a computer program product. The program product is stored in a storage medium. The program product is executed by at least one processor to implement each process of the above-mentioned test method embodiment and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0175] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including that element.

[0176] In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed. It may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.

[0177] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present application.

[0178] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.

Claims

1. A testing method, characterized in that, Including: When receiving a test command, obtaining a test case directory corresponding to the test command; The test case directory includes N subdirectories, and each subdirectory includes M test scripts, where N and M are integers greater than or equal to 1; Performing a test operation according to the test case directory; wherein, when running the test scripts of one of the subdirectories, displaying the test data of the test scripts of the subdirectory in the display window corresponding to the subdirectory.

2. The method according to claim 1, wherein N is an integer greater than 1, and the test data includes test result data; the performing the test operation according to the test case directory includes: Determining the i-th subdirectory from the N subdirectories through a service programming module; Running the M test scripts in the i-th subdirectory through a test interaction suite, and transmitting the test result data of each test script in the i-th subdirectory to the service programming module; When the service programming module obtains the test result data of each test script in the i-th subdirectory, determining the (i + 1)-th subdirectory from the N subdirectories through the service programming module; Running the M test scripts in the (i + 1)-th subdirectory through the test interaction suite.

3. The method according to claim 2, wherein The running order of the N subdirectories is determined according to the order of the directory names of the N subdirectories.

4. The method according to claim 2, wherein M is an integer greater than 1; the running the M test scripts in the i-th subdirectory through the test interaction suite includes: Running the M test scripts in the i-th subdirectory in the traversal order of the N subdirectories through the test interaction suite.

5. The method according to claim 2, characterized in that, Before running the M test scripts in the i-th subdirectory through the test interaction suite, the method further includes: Transmitting a resource request to the service programming module through the test interaction suite, where the resource request is used to request the service programming module to feedback the dependent resources for running the M test scripts in the i-th subdirectory; Determining whether the dependent resources are included in a first resource set through the service programming module, where the first resource set includes resources related to the test scripts that have been executed in the N subdirectories and the identifiers of the resources; When determining that the dependent resources are included in the first resource set, removing the identifier of the dependent resources from the first resource set, and transmitting the dependent resources to the test interaction suite through the service programming module.

6. The method according to claim 5, characterized in that, The method further includes: When determining that the dependent resources are not included in the first resource set, adding the identifier of the dependent resources to a second resource set, and pausing the running of the test scripts in the i-th subdirectory through the test interaction suite; When the new resources are included in the first resource set and the new resources are the dependent resources, deleting the identifier of the dependent resources from the second resource set and removing the identifier of the new resources from the first resource set, and transmitting the dependent resources to the test interaction suite through the service programming module.

7. The method according to claim 1, wherein The test data includes test result data; the method further includes: Obtain the expected blocking duration of the j-th test script in the sub-directory; In the case that the test result data of the j-th test script is not obtained within the expected blocking duration, stop running the M test scripts in the sub-directory; In the display window corresponding to the sub-directory, differentially display the test data related to the j-th test script.

8. The method according to claim 7, characterized in that, Displaying the test data of each test script in the sub-directory in the display window corresponding to the sub-directory includes: In the case that the test result data of the j-th test script is obtained within the expected blocking duration, run the test scripts after the j-th test script in the sub-directory, and display the test data of the test scripts after the j-th test script in the display window corresponding to the sub-directory.

9. A testing device, characterized in that, Including: An acquisition module, configured to obtain a test case directory corresponding to the test command when receiving the test command, the test case directory includes N sub-directories, the sub-directory includes M test scripts, and N and M are integers greater than or equal to 1; An execution module, configured to perform a test operation according to the test case directory; wherein, when running the test scripts of one of the sub-directories, display the test data of the test scripts of the sub-directory in the display window corresponding to the sub-directory.

10. An electronic device, characterized in that, Including: A processor, a memory, and a program or instruction stored on the memory and executable on the processor, and when the program or instruction is executed by the processor, the steps of the test method according to any one of claims 1-8 are implemented.