Software automation testing method and device suitable for multiple operating systems

By receiving and sending test actions on the server, application software testing on different operating systems can be achieved in the same testing environment. This solves the problems of high development costs and lack of portability of test programs in existing technologies, and reduces development, debugging and maintenance costs.

CN115408286BActive Publication Date: 2026-04-14VERISILICON MICROELECTRONICS (SHANGHAI) CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing technologies require the development of separate test programs for testing application software on different operating systems, resulting in high development, debugging, and maintenance costs, and the test programs lack portability.

Method used

This paper provides a software automation testing method applicable to multiple operating systems. The method receives test requests through a server, sends test actions to the client of the program under test with the same target operating system, and feeds back test information to the test program client, thereby realizing the testing of application software with different operating systems in the same test environment.

Benefits of technology

It reduces development, debugging, and maintenance costs, enables testing of application software on different operating systems in the same testing environment, and improves the portability of test programs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408286B_ABST
    Figure CN115408286B_ABST
Patent Text Reader

Abstract

The application provides a software automatic test method and device suitable for multiple operating systems. The method is applied to a server connected with a test program client and multiple tested program clients. The multiple tested program clients run multiple operating systems. The method comprises the following steps: receiving a test request sent by the test program client; sending a test action in the test request to a target tested program client consistent with a target operating system; receiving test information sent by the target tested program client; receiving a test information acquisition request sent by the test program client; and sending the test information sent by the target tested program client consistent with the target operating system to the test program client, so that the test program client determines a test result of the target tested program client according to the test information, thereby realizing the test on application software of different operating systems in the same test environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software testing, and more specifically, to a software automated testing method and apparatus applicable to multiple operating systems. Background Technology

[0002] With the development of smart terminals and application software, applications with the same functionality may exist in various forms, including APK (Application Package) applications on Android devices, APP (Application Package) applications on iOS devices, and applications on Linux or Windows operating systems. Testing applications on different operating systems requires developing corresponding test programs tailored to the characteristics of each operating system. For example, for APK applications on Android devices, a test program for Android APKs needs to be developed using Java; for APP applications on iPhone / iPad devices, a test program for iOS needs to be developed using Objective-C; and for applications on Linux or Windows operating systems, a test program needs to be developed using Python or Java.

[0003] It is evident that, currently, when testing application software under different operating systems, it is necessary to understand the characteristics of each operating system and develop corresponding application test programs. This results in high development, debugging, and maintenance costs, and the developed test programs lack portability. Summary of the Invention

[0004] The purpose of this application is to provide a software automated testing method and apparatus applicable to multiple operating systems, so as to realize that when testing application software under different operating systems, it is not limited by the operating system of the application software under test, and can test application software under different operating systems in the same testing environment.

[0005] In a first aspect, the present invention provides a software automated testing method applicable to multiple operating systems, applied to a server, wherein the server is connected to a test program client and multiple test program clients, the multiple test program clients running various operating systems, the method comprising: receiving a test request sent by the test program client, wherein the test request includes a target operating system and a test action; sending the test action in the test request to a target test program client consistent with the target operating system, so that the target test program client performs testing according to the test action; receiving test information sent by the target test program client, wherein the test information is determined by the target test program client after performing testing according to the test action; receiving a test information acquisition request sent by the test program client, wherein the test information acquisition request includes the target operating system; and sending the test information sent by the target test program client consistent with the target operating system to the test program client, so that the test program client determines the test result of the target test program client according to the test information.

[0006] In the above scheme, when it is necessary to test software programs on a specific operating system or software programs on multiple different operating systems at the same time, the test program client only needs to send a test request to the server, which includes the target operating system and the test actions. The server then sends the test actions to the target test program client corresponding to the target operating system, thereby enabling the testing of application software on different operating systems in the same test environment, reducing development costs, debugging costs, and maintenance costs.

[0007] In an optional implementation, the server is a RESTful server, and the test program client and the program under test client are both RESTful clients; or the server is an HTTP (Hypertext Transfer Protocol) server, and the test program client and the program under test client are both HTTP clients, with the HTTP client communicating with the HTTP server using the HTTP protocol.

[0008] In the above solution, deploying a single RESTful server can support testing multiple programs running on different operating systems, thus offering high reusability.

[0009] In an optional implementation, the test request is a POST request (sending data to the server). The POST request includes a request body (generally used to store the parameters and parameter data of the POST request). The request body includes a first preset field and a second preset field. Sending the test action in the test request to the target program under test client that is consistent with the target operating system includes: determining the target operating system based on the first preset field; determining the test action based on the second preset field; and sending the test action to the target program under test client that is consistent with the target operating system.

[0010] In an optional implementation, the test action includes a scanning action, in which the target test program client performs a scan according to the scanning action and records the scanned device information as the test information.

[0011] In an optional implementation, the test program client determines whether the device information contains the desired device; if it does, the test result of the target test program client is determined to be a successful test; if it does not, the test result of the target test program client is determined to be a failed test.

[0012] In an optional implementation, sending the test action in the test request to the target program under test client that is consistent with the target operating system includes: receiving heartbeat information sent by the target program under test client that is consistent with the target operating system; when it is determined that the target operating system in the test request is consistent with the operating system of the target program under test client, sending the test action in the test request as the return information of the heartbeat information to the target program under test client.

[0013] In an optional implementation, the heartbeat information includes the server's port number and IP address.

[0014] Secondly, the present invention provides a software automated testing device applicable to multiple operating systems, applied to a server. The server is connected to a test program client and multiple test program clients, the multiple test program clients running various operating systems. The device includes: a receiving module for receiving a test request sent by the test program client, wherein the test request includes a target operating system and a test action; a sending module for sending the test action in the test request to a target test program client that has the same operating system as the target operating system, so that the target test program client performs testing according to the test action; the receiving module is also used to receive test information sent by the target test program client, wherein the test information is determined by the target test program client after performing testing according to the test action; receiving a test information acquisition request sent by the test program client, wherein the test information acquisition request includes the target operating system; the sending module is also used to send the test information sent by the target test program client that has the same operating system as the target operating system to the test program client, so that the test program client determines the test result of the target test program client according to the test information.

[0015] Thirdly, the present invention provides an electronic device, comprising: a processor and a memory; the memory stores program instructions executable by the processor, and the processor invokes the program instructions to execute the method described in any of the foregoing embodiments.

[0016] Fourthly, the present invention provides a computer-readable storage medium storing computer program instructions, which, when read and executed by a computer, perform the method as described in any of the foregoing embodiments. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating a software automated testing method applicable to multiple operating systems, provided as an embodiment of this application;

[0019] Figure 2 A schematic diagram illustrating a test scenario for multiple operating systems provided in an embodiment of this application;

[0020] Figure 3A complete flowchart of a software automated testing method applicable to multiple operating systems is provided for embodiments of this application;

[0021] Figure 4 This application also provides a structural block diagram of a software automated testing device suitable for multiple operating systems;

[0022] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0023] Icons: 400 - Software automation testing device suitable for multiple operating systems; 410 - Receiver module; 420 - Transmitter module; 500 - Electronic device; 510 - Processor; 520 - Memory. Detailed Implementation

[0024] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0025] This application provides a software automated testing method and apparatus applicable to multiple operating systems, which enables testing of application software under different operating systems without being limited by the operating system of the application software being tested, and allows testing of application software under different operating systems in the same testing environment.

[0026] Please see Figure 1 , Figure 1 The flowchart illustrates a software automation testing method applicable to multiple operating systems, as provided in this application embodiment. This method is applied to a server, which connects to a test program client and multiple test program clients. These test program clients run on various operating systems. The software automation testing method applicable to multiple operating systems may include the following:

[0027] Step 101: Receive the test request sent by the test program client.

[0028] Step 102: Send the test actions in the test request to the target program under test client that is consistent with the target operating system, so that the target program under test client can perform the test according to the test actions.

[0029] Step 103: Receive test information sent by the target program client.

[0030] Step 104: Receive the test information retrieval request sent by the test program client.

[0031] Step 105: Send the test information sent by the target program client, which is consistent with the target operating system, to the test program client so that the test program client can determine the test result of the target program client based on the test information.

[0032] In this embodiment, the test program client sends a test request to the server, the test request including the target operating system and test actions. After receiving the test request from the test program client, the server parses the test request and sends the test actions in the test request to the target program client with the same target operating system. Upon receiving the test actions sent by the server, the target program client executes the test actions by calling its own program code corresponding to the test actions, and determines the test information. Then, it sends the test information to the server. The test program client also sends a test information retrieval request to the server, the test information retrieval request including the target operating system. This target operating system represents the test information that the test program client hopes to obtain for the target program client corresponding to the target operating system. Upon receiving the test information retrieval request, the server sends the test information sent by the target program client with the same target operating system to the test program client, based on the target operating system in the test retrieval request. The test program client then determines the test result of the target program client based on the test information.

[0033] Using the above method, when it is necessary to test software programs on a specific operating system or software programs on multiple different operating systems simultaneously, the test program client only needs to send a test request to the server, including the target operating system and the test actions. The server then sends the test actions to the target test program client corresponding to the target operating system, thereby enabling the testing of the software program on the corresponding operating system.

[0034] In some implementations, the server can be an HTTP server, and the test program client and the program under test client can be HTTP clients, accessing the HTTP server via the HTTP protocol.

[0035] In some implementations, the server can be a RESTful server, and the test program client and the program under test client can be RESTful clients, communicating with the RESTful server via a wireless network.

[0036] For example, please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating a test scenario for multiple operating systems provided in an embodiment of this application. For example... Figure 2As shown, this test scenario involves three client programs under test: one client program is an APK running on an Android device; one client program is an App running on an iOS device; and one client program is a Linux or Windows application running on a Linux or Windows device. The test client runs on a Linux or Windows device. It can be understood that in the REST (Representational State Transfer) framework, the RESTful server and each RESTful client interact through REST requests and REST responses.

[0037] Understandable, Figure 2 In the test scenario shown, the three tested application clients are running different operating systems: one is running Android, one is running iOS, and one is running Linux.

[0038] In other implementations, multiple client programs under test may include those running the same operating system. For example, in one test scenario, there are four client programs under test: client program 1 and client program 2 both run on Android, client program 3 runs on iOS, and client program 4 runs on Linux. In another test scenario, there are four client programs under test: client program 1 and client program 2 both run on Android, and client program 3 and client program 4 both run on iOS. This application does not specifically limit the operating systems running on the multiple client programs under test.

[0039] The following is Figure 2 Taking the corresponding test scenario as an example, the above steps will be introduced.

[0040] Step 101: Receive the test request sent by the test program client.

[0041] In this embodiment of the application, the test program client sends a test request to the server. The test request includes the target operating system and the test action.

[0042] The target operating system in the test request represents the operating system of the software program under test in the current software test. It can be understood that multiple clients of the tested program connected to the server are running different operating systems, such as Android, iOS, Linux, or Windows. For example, if the operating system of the software program under test in the current software test is Android, then the target operating system is Android.

[0043] Test actions are used to characterize the test actions that the software under test needs to perform during the current software testing. For example, test actions can be Bluetooth scanning actions (i.e., testing whether the Bluetooth scanning function of the software program is normal), Wi-Fi (wireless network) scanning actions (i.e., testing whether the Bluetooth scanning function of the software program is normal), etc.

[0044] When testing begins, the test program client sends a test request to the RESTful server, and the RESTful server receives the test request sent by the test program client.

[0045] In some implementations, the test request is a POST request. A POST request includes a URL (Uniform Resource Locator) and a request body. The URL consists of the IP address (Internet Protocol Address) and port number of the RESTful server. For example, assuming the RESTful server's IP address is 10.10.46.170 and port number 5000, the URL of this POST request would be: http: / / 10.10.46.170:5000 / api / test.

[0046] The request body includes a first preset field and a second preset field. The first preset field represents the target operating system, and the second preset field represents the test action. For example, it is predefined that: Android operating system is represented by the character "0", iOS operating system by the character "1", Linux or Windows operating system by the character "2", and the test action is Bluetooth scanning test, represented by the string "device_scan". Assuming that the target operating system for this software test is Android operating system and the test action is Bluetooth scanning test, then the request body of this POST request is: {"connection":"0","action":"device_scan"}.

[0047] Step 102: Send the test actions in the test request to the target program under test client that is consistent with the target operating system, so that the target program under test client can perform the test according to the test actions.

[0048] In this embodiment, after receiving a test request from the test program client, the RESTful server parses the test request to determine the target operating system and test actions. Based on the target operating system in the test request, the server determines the software to be tested corresponding to this software test request (i.e., determining the target client for this software test from multiple client-side test programs), and the operating system of the target client is consistent with the target operating system in the test request. Then, the parsed test actions are sent to the target client so that the target client can perform the test according to the test actions.

[0049] As an optional implementation, sending the test action in the test request to the target program under test client that is consistent with the target operating system includes: determining the target operating system according to a first preset field; determining the test action according to a second preset field; and sending the test action to the target program under test client that is consistent with the target operating system.

[0050] In this embodiment of the application, the test program client sends a test request to the RESTful server as a Post request. The Post request includes a request body, which includes a first preset field and a second preset field.

[0051] For example, the body of a received POST request might be: {"connection":"0","action":"device_scan"}, where the first preset field is "connection":"0" and the second preset field is "action":"device_scan". Based on the first preset field, the target operating system is determined to be Android. Based on the second preset field, the test action is determined to be "device_scan" (i.e., performing a Bluetooth scan test). The RESTful server will treat the Android client application connected to it as the target client application and send the test action corresponding to the second preset field to that target client application.

[0052] Furthermore, in some implementation methods, sending the test actions in the test request to the target program under test client that is consistent with the target operating system includes: receiving heartbeat information sent by the target program under test client that is consistent with the target operating system; when it is determined that the target operating system in the test request is consistent with the operating system of the target program under test client, sending the test actions in the test request as the return information of the heartbeat information to the target program under test client.

[0053] In this embodiment, each client program under test sends heartbeat information to the RESTful server at preset time intervals. When the RESTful server does not receive a test request from the client program under test, it sends an empty message as a return message for the heartbeat information to the client program under test. When the RESTful server receives a test request from the client program under test and determines that the target operating system in the test request is consistent with the operating system of the target client program under test, it sends the test action in the test request as a return message for the heartbeat information to the target client program under test.

[0054] Furthermore, the heartbeat information sent by the client application under test includes the port number and IP address of the RESTful server. In some implementations, the heartbeat information can be a GET request. For example, assuming the IP address of the RESTful server is 10.10.46.170 and the port number is 5000, the GET request would be: http: / / 10.10.46.170:5000 / api / heartbeat.

[0055] Step 103: Receive test information sent by the target program client.

[0056] In this embodiment of the application, after the target program client receives the test action sent by the RESTful server, it calls its own program code corresponding to the test action to execute the test action and determine the test information.

[0057] In some implementations, when the test action is a scanning action, the target program client receives the scanning action, calls its own scanning-related program code to scan surrounding devices, and records the scanned device information as test information. The test information is then sent to a RESTful server, which stores the test information.

[0058] Specifically, the target application client can send test information to the RESTful server via a POST request. The request body of this POST request also has a first preset field, which is used to characterize the operating system of the target application client. The specific form is the same as the first preset field in the request body of the POST request in the aforementioned test request, and will not be repeated here for the sake of brevity.

[0059] Step 104: Receive the test information retrieval request sent by the test program client.

[0060] Step 105: Send the test information sent by the target program client, which is consistent with the target operating system, to the test program client so that the test program client can determine the test result of the target program client based on the test information.

[0061] In this embodiment of the application, the test information acquisition request includes the target operating system. After receiving the test information acquisition request sent by the test program client, the RESTful server sends the test information sent by the target program client corresponding to the target operating system to the test program client according to the target operating system in the test information acquisition request. The test client determines the test result of the target program client according to the test information.

[0062] In some implementations, when the test action is a scanning action, the test result sent by the target program under test client is the device information scanned by the target program under test client. The test client determines whether the device information contains the expected device; if it does, the test result of the target program under test client is determined to be a test pass; if it does not, the test result of the target program under test client is determined to be a test failure.

[0063] It is understandable that the test client has the expected device information preset. The test client checks the device information scanned by the target program client. If the target program client's scanned device information contains the expected device information, it means that the target program client's scanning function is normal, and the test result for the target program client is "test passed". If the target program client's scanned device information does not contain the expected device information, it means that the target program client's scanning function is abnormal, and the test result for the target program client is "test failed".

[0064] For easier understanding, please refer to Figure 3 , Figure 3 A complete flowchart of a software automated testing method applicable to multiple operating systems, provided for embodiments of this application. Figure 3As shown, assuming the target operating system for this software test is Android, the test action is a Bluetooth scanning test, and the test program client (corresponding to...) Figure 3 The Test Application in the middle sends data to the Restful server (corresponding to...). Figure 3 Send a test request (corresponding to the Restful Server in the middle) Figure 3 (POST / api / test "connection": "0", "device_scan").

[0065] After receiving the test request, the RESTful server uses the test action "device_scan" in the test request as the target client program under test (corresponding to...). Figure 3 The APK in the middle sends heartbeat information (corresponding to) Figure 3 The return information from GET / api / heartbeat is sent to the target tested program client.

[0066] The target application client performs a scanning test based on the test action "device_scan", and uses the scanned device information as test information (corresponding to...). Figure 3 The POST (API / device_scan) data is sent to the RESTful server, which then stores the test information.

[0067] The test program client sends a test information retrieval request to the RESTful server (corresponding to...) Figure 3 In the GET request to "connection / 0 / devices", the RESTful server sends the saved test information to the test client. The test client checks whether the device information scanned by the target application client contains the preset expected device information. If it does, the test passes; otherwise, it fails. Figure 3 (check scanlist).

[0068] It should be noted that the above embodiments are all described using software testing of a single target program client as an example. The software automation testing method applicable to multiple operating systems provided in this application can test multiple target program clients simultaneously. The process of testing each target program client is the same as that in the above embodiments, and will not be repeated here for the sake of brevity.

[0069] Based on the same inventive concept, please refer to Figure 4 , Figure 4This application also provides a structural block diagram of a software automated testing device suitable for multiple operating systems. The software automated testing device 400 suitable for multiple operating systems may include:

[0070] The receiving module 410 is used to receive a test request sent by the test program client, wherein the test request includes a target operating system and a test action;

[0071] The sending module 420 is used to send the test actions in the test request to the target program under test client that is consistent with the target operating system, so that the target program under test client can perform tests according to the test actions;

[0072] The receiving module 410 is further configured to receive test information sent by the target program under test client, wherein the test information is determined by the target program under test client after performing tests according to the test actions; and to receive a test information acquisition request sent by the test program client, wherein the test information acquisition request includes the target operating system;

[0073] The sending module 420 is further configured to send test information sent by the target program client that is consistent with the target operating system to the test program client, so that the test program client can determine the test result of the target program client based on the test information.

[0074] In an optional implementation, the server is a RESTful server, and the test program client and the program under test client are RESTful clients.

[0075] In an optional implementation, the test request is a POST request, which includes a request body. The request body includes a first preset field and a second preset field. The sending module is specifically used to determine the target operating system based on the first preset field; determine the test action based on the second preset field; and send the test action to the target program client that is consistent with the target operating system.

[0076] In an optional implementation, the test action includes a scanning action, in which the target test program client performs a scan according to the scanning action and records the scanned device information as the test information.

[0077] In an optional implementation, the test program client determines whether the device information contains the desired device; if it does, the test result of the target test program client is determined to be a successful test; if it does not, the test result of the target test program client is determined to be a failed test.

[0078] In an optional implementation, the sending module 420 is specifically used to receive heartbeat information sent by a target program client that is consistent with the target operating system; when it is determined that the target operating system in the test request is consistent with the operating system of the target program client, the test action in the test request is sent to the target program client as the return information of the heartbeat information.

[0079] In an optional implementation, the heartbeat information includes the server's port number and IP address.

[0080] The software automation testing device 400 applicable to multiple operating systems corresponds to the aforementioned software automation testing method applicable to multiple operating systems. Each functional module corresponds to each step of the aforementioned software automation testing method applicable to multiple operating systems. Therefore, the implementation methods of each functional module refer to the implementation methods of the software automation testing method applicable to multiple operating systems in the aforementioned embodiments, and will not be repeated here.

[0081] Please refer to Figure 5 This application embodiment also provides an electronic device 500, which can serve as the execution subject of the aforementioned software automated testing method applicable to multiple operating systems, including: processor 510 and memory 520.

[0082] The memory 520 stores instructions that can be executed by the processor 510. The processor 510 executes the instructions to enable the processor 510 to perform the software automation testing method applicable to multiple operating systems in the foregoing embodiments.

[0083] The processor 510 and memory 520 can be connected via a communication bus, or via communication modules such as wireless communication modules, Bluetooth communication modules, Wi-Fi communication modules, 2G (second-generation mobile communication technology), 3G (third-generation mobile communication technology), 4G (fourth-generation mobile communication technology), and 5G (fifth-generation mobile communication technology) communication modules.

[0084] Processor 510 can be an integrated circuit chip with signal processing capabilities. Processor 510 can be a general-purpose processor, including a CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be a digital signal processor, application-specific integrated circuit, off-the-shelf programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor.

[0085] The memory 520 may include, but is not limited to, RAM (Random Access Memory), ROM (Read Only Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.

[0086] It is understood that the electronic device 500 may also include more general modules required by itself, which will not be described one by one in the embodiments of this application.

[0087] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when run by a computer, performs the steps of the software automated testing method applicable to multiple operating systems as described in the above embodiments.

[0088] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0089] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0090] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0091] It should be noted that if the function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0092] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0093] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A software automated testing method applicable to multiple operating systems, characterized in that, Applied to a server, the server is connected to a test program client and multiple test program clients, the multiple test program clients running various operating systems, the method includes: Receive a test request sent by the test program client, wherein the test request includes the target operating system and the test action; The test action in the test request is sent to the target program client that is consistent with the target operating system, so that the target program client calls its own program code corresponding to the test action to execute the test action and determine the test information. Receive test information sent by the target program under test client, wherein the test information is determined by the target program under test client after performing a test according to the test action; Receive a test information acquisition request sent by the test program client, wherein the test information acquisition request includes the target operating system; The test information sent by the target program client, which is consistent with the target operating system, is sent to the test program client so that the test program client can determine the test result of the target program client based on the test information.

2. The method according to claim 1, characterized in that, The server is a RESTful server, and the test program client and the program under test client are both RESTful clients; or the server is an HTTP server, and the test program client and the program under test client are both HTTP clients, with the HTTP client communicating with the HTTP server using the HTTP protocol.

3. The method according to claim 2, characterized in that, The test request is a POST request, which includes a request body. The request body includes a first preset field and a second preset field. Sending the test action in the test request to the target program client that is consistent with the target operating system includes: The target operating system is determined based on the first preset field; The test action is determined based on the second preset field; The test action is sent to the target program client that is consistent with the target operating system.

4. The method according to claim 3, characterized in that, The test action includes a scanning action, in which the target program client performs a scan according to the scanning action and records the scanned device information as the test information.

5. The method according to claim 4, characterized in that, The test program client determines whether the device information contains the desired device; If included, the test result of the target program client is determined to be a successful test; If not included, the test result for the target program client is determined to be a test failure.

6. The method according to any one of claims 1-5, characterized in that, Sending the test actions in the test request to the target program client, which is consistent with the target operating system, includes: Receive heartbeat information sent by the target program client that is consistent with the target operating system; When it is determined that the target operating system in the test request is consistent with the operating system of the target program client under test, the test action in the test request is sent to the target program client under test as the return information of the heartbeat information.

7. The method according to claim 6, characterized in that, The heartbeat information includes the server's port number and IP address.

8. A software automated testing device suitable for multiple operating systems, characterized in that, Applied to a server, the server is connected to a test program client and multiple test program clients, the multiple test program clients running various operating systems, the device comprising: A receiving module is used to receive a test request sent by the test program client, wherein the test request includes the target operating system and the test action; The sending module is used to send the test action in the test request to the target test program client that is consistent with the target operating system, so that the target test program client calls its own program code corresponding to the test action to execute the test action and determine the test information. The receiving module is further configured to receive test information sent by the target program under test client, wherein the test information is determined by the target program under test client after performing tests according to the test actions; and to receive a test information acquisition request sent by the test program client, wherein the test information acquisition request includes the target operating system; The sending module is further configured to send test information sent by the target program client that is consistent with the target operating system to the test program client, so that the test program client can determine the test result of the target program client based on the test information.

9. An electronic device, characterized in that, include: Processor, memory; The memory stores program instructions that can be executed by the processor, and the processor can execute the method as described in any one of claims 1-7 by calling the program instructions.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when read and executed by a computer, perform the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Test method and device

    CN109495334A

  • Program multi-system testing method and corresponding device, equipment and medium

    CN113672502A