Application multi-device compatibility testing method, system, device and storage medium

By integrating prefabricated testing tools in the Android app, establishing one-to-many connections, monitoring and simulating user operations, generating and summarizing system logs, the problem of low compatibility testing of Android apps is solved, and efficient multi-device compatibility testing is achieved.

CN115658502BActive Publication Date: 2025-08-01AFIRSTSOFT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211304830.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2025-08-01
Estimated Expiration
2042-10-24

AI Technical Summary

Technical Problem

In the prior art, the Android app compatibility testing method is inefficient, manual real-time testing requires a lot of repetition, while cloud testing platform testing cannot be visualized and is costly, making it difficult to cover all compatibility problems.

Method used

The prefabricated test tool is integrated in the application to be tested, establish a one-to-many connection with multiple clients through one control end, listen to user operations to generate an operation event queue, and send it to the client through a data transmission channel, invoke accessibility service simulation operations, and obtain and summarize the system log to generate a test report.

Benefits of technology

It realizes testing multiple devices simultaneously, improves testing efficiency, reduces duplicate work, provides visual testing process and automated test report generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658502B_ABST
    Figure CN115658502B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system, device and storage medium for multi-device compatibility testing of application programs. The method of the present invention integrates a prefabricated test tool into the application program to be tested and installs it into multiple devices to be tested; configures the control end and client roles through the prefabricated test tool and establishes a one-to-many connection between the control end and multiple clients; then listens for operations of the user on the control end on each level interface of the application program to be tested to generate an operation event queue; then sends the operation event queue to multiple clients through a data transmission channel; then calls the accessibility service in the client to simulate each operation in the operation event queue and obtain the system log generated by the client; finally, the system log set generated by the client is transmitted back to the control end, and by summarizing the system logs of the control end and the client, an application program test report for different devices can be obtained. The method of the present invention realizes controlling one device to test multiple devices simultaneously, improving the test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to a method, system, device and storage medium for multi-device compatibility testing of application programs. Background Art

[0002] The compatibility testing of Android apps is an essential process in app software development. During the app software development process, the app development engineer hands over the developed software to the test engineer for testing. In addition to basic function testing, usability testing, performance testing, etc., it is also necessary to perform compatibility testing on different screen resolutions, different Android system versions, different Android phone brands and other differential elements to ensure that the app can run stably on as many devices as possible on the market.

[0003] Common app compatibility testing solutions include manual real-device testing and automated testing on cloud testing platforms. Manual real-device testing is to select several representative devices from each differential element according to the software characteristics and test requirements. The test engineer performs compatibility testing on each device manually or in cooperation with the monkey tool, and the same test cases need to be executed on each device, resulting in a large amount of repetitive work. If the test coverage is to be improved, the number of selected devices increases, which also means more repetitive work. Automated testing on cloud testing platforms is to upload the app software and the written test script to the cloud testing platform of a third-party service provider, select the required device models and quantities, submit the test and wait for the test results. The test process cannot be visualized, and the platform only runs the test according to the process set by the script. It is difficult to reproduce complex scenarios, and the script needs to be repeatedly optimized to screen out all compatibility problems. Moreover, each test on the third-party cloud testing platform needs to be charged to use.

[0004] Currently, the method of using manual real devices for app compatibility testing can only test one mobile phone platform at a time, which requires a large amount of repetitive work by engineers and has low test efficiency.

[0005] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention

[0006] The main purpose of the present invention is to provide a method, system, device and storage medium for multi-device compatibility testing of application programs to solve the above problems of the existing technology.

[0007] The first aspect of the present invention provides a method for multi-device compatibility testing of application programs, including the following steps:

[0008] Integrate a prefabricated test tool into the installation package of the application under test, so that after the application under test is clicked to open, it first enters the operation panel interface of the prefabricated test tool;

[0009] Install the application integrated with the prefabricated test tool into multiple devices to be tested for compatibility;

[0010] Select one of the multiple devices to be tested for compatibility as the control end, and the remaining devices to be tested for compatibility as the client ends. Establish a one-to-many connection between the control end and multiple client ends through the operation panel interface;

[0011] Monitor the operations of the user on each level of the interface of the application to be tested on the control end, generate an operation event queue, and obtain the first system log generated by the control end;

[0012] Send the operation event queue to multiple client ends through the data transmission channel between the control end and the client ends;

[0013] Invoke the accessibility service in the client end to simulate the operations in the operation event queue, and obtain the second system log generated by the client end;

[0014] Transmit the second system log set generated by the client end back to the control end, and summarize the first system log and the second system log in the control end to obtain a test report.

[0015] In an optional implementation manner of the first aspect of the present invention, the step of selecting one of the multiple devices to be tested for compatibility as the control end, and the remaining devices to be tested for compatibility as the client ends, and establishing a one-to-many connection between the control end and multiple client ends through the operation panel interface includes:

[0016] Open the application to be tested in the control end and enter the operation panel interface of the prefabricated test tool;

[0017] Start the ServerSocket connection service with a fixed IP address and port number in the operation panel interface of the control end;

[0018] Open the application to be tested in the client end and enter the operation panel interface of the prefabricated test tool;

[0019] Click Connect Socket in the operation panel interface of the client end to complete the communication connection between the client end and the control end.

[0020] In an optional implementation manner of the first aspect of the present invention, the step of clicking Connect Socket in the operation panel interface of the client end to complete the communication connection between the client end and the control end includes:

[0021] When the control end receives a Socket connection request sent by the client, a new data transmission channel and a new data processing thread will be enabled to handle the data transmission between the control end and the client, and the client will be added to the list of connected devices.

[0022] In an optional implementation manner of the first aspect of the present invention, opening the application under test in the control end and entering the operation panel interface of the prefabricated test tool, and opening the application under test in the client and entering the operation panel interface of the prefabricated test tool include:

[0023] Open the application under test to generate a window requesting accessibility service;

[0024] After the request for accessibility service is allowed, enter the operation panel interface of the prefabricated test tool, and at the same time, a semi-transparent floating window for displaying the real-time status information of the device is generated at the corner of the operation panel interface.

[0025] In an optional implementation manner of the first aspect of the present invention, listening to the operations of the user on each level interface of the application under test on the control end, generating an operation event queue, and obtaining the first system log generated by the control end include:

[0026] Listen to the operations of the user on each level interface of the application under test on the control end;

[0027] For each monitored operation event, add the operation event to the head of the operation event queue through a preset queue addition function;

[0028] After monitoring the end of the operation, obtain the first system log generated by the control end during the operation period from the log storage address of the control end.

[0029] In an optional implementation manner of the first aspect of the present invention, sending the operation event queue to multiple clients through the data transmission channel between the control end and the client includes:

[0030] Traverse each client connected to the control end;

[0031] Use a preset queue extraction function to extract one operation event from the tail of the operation event queue each time;

[0032] Send the extracted operation events to each client in the traversal order until all the operation events in the operation event queue are sent to each client.

[0033] In an alternative embodiment of the first aspect of the present invention, the prefabricated test tool includes a permission application module, a socket connection communication module for the control end and the receiving end, a barrier-free service module, a log output module, and the operation panel interface.

[0034] The second aspect of the present invention provides an application multi-device compatibility test system, and the application multi-device compatibility test system includes:

[0035] A test tool integration module for integrating the prefabricated test tool into the installation package of the application under test, so that after the application under test is clicked and opened, it first enters the operation panel interface of the prefabricated test tool;

[0036] A software installation module for installing the application integrated with the prefabricated test tool into multiple devices to be compatibly tested;

[0037] A device connection module for taking one of the multiple devices to be compatibly tested as the control end, and the remaining devices to be compatibly tested as the client, and establishing a one-to-many connection between the control end and the multiple clients through the operation panel interface;

[0038] An operation event listening module for listening to the operations of the user on the various interfaces of the application under test on the control end, generating an operation event queue, and obtaining the first system log generated by the control end;

[0039] An operation event queue sending module for sending the operation event queue to the multiple clients through the data transmission channel between the control end and the clients;

[0040] An operation event simulation execution module for calling the barrier-free service in the client to simulate the operations in the operation event queue, and obtaining the second system log generated by the client;

[0041] A report summarization module for collecting the second system log set generated by the client back to the control end, and summarizing the first system log and the second system log in the control end to obtain a test report.

[0042] The third aspect of the present invention provides an application multi-device compatibility test device, and the application multi-device compatibility test device includes: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected by a line;

[0043] The at least one processor calls the instructions in the memory so that the application multi-device compatibility test device executes the application multi-device compatibility test method as described in any one of the above.

[0044] In a fourth aspect of the present invention, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the application program multi-device compatibility testing method described in any one of the above is implemented.

[0045] Beneficial effects: The present invention provides an application program multi-device compatibility testing method, system, device and storage medium. The method of the present invention integrates a prefabricated testing tool into the application program to be tested and installs it into multiple devices to be tested; configures the control end and client roles through the prefabricated testing tool and establishes a one-to-many connection between the control end and multiple clients; then listens to the operations of the user on the various interfaces of the application program to be tested on the control end to generate an operation event queue; then sends the operation event queue to multiple clients through a data transmission channel; then calls the accessibility service in the client to simulate the operations in the operation event queue and obtain the system logs generated by the client; finally, transmits the system log set generated by the client back to the control end, and summarizes the system logs of the control end and the client to obtain the application program test reports of different devices. The method of the present invention realizes controlling one device to test multiple devices at the same time, improving the testing efficiency. Description of the Drawings

[0046] Figure 1 It is a schematic diagram of an embodiment of an application program multi-device compatibility testing method of the present invention;

[0047] Figure 2 It is a schematic diagram of an embodiment of the operation panel interface of a prefabricated testing tool of the present invention;

[0048] Figure 3 It is a schematic diagram of an embodiment of an application program multi-device compatibility testing system of the present invention;

[0049] Figure 4 It is a schematic diagram of an embodiment of an application program multi-device compatibility testing device of the present invention. Detailed Embodiments

[0050] Embodiments of the present invention provide an application program multi-device compatibility testing method, system, device and storage medium. Terms such as "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described here can be in a form other than that illustrated here.

[0051] or implemented in an order other than that described. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0052] Refer to Figure 1 , the first aspect of the present invention provides an application multi-device compatibility testing method, including the following steps:

[0053] S100. Integrate a prefabricated test tool into the installation package of the application to be tested, so that after the application to be tested is clicked to open, it first enters the operation panel interface of the prefabricated test tool; in the present invention, the prefabricated test tool includes a permission application module, a socket connection communication module for the control end and the receiving end, an accessibility service module, a log output module, and an operation panel interface; the purpose of integrating the prefabricated test tool into the installation package of the application is to establish a communication connection between subsequent test devices;

[0054] S200. Install the application integrated with the prefabricated test tool into multiple devices to be compatibility tested; in the present invention, generally speaking, the multiple devices to be compatibility tested used refer to devices with different screen resolutions, different Android system versions, and different manufacturer brands, so as to ensure that the software can run stably on different devices after testing;

[0055] S300. Select one of the multiple devices to be compatibility tested as the control end, and the remaining devices to be compatibility tested as the client ends, and establish a one-to-many connection between the control end and the multiple client ends through the operation panel interface; in the present invention, the control end is the operation end of the test, and the client ends are the passive test ends, and the manipulation of multiple client ends is realized by operating on the control end;

[0056] S400 listens to the operations of the user on each level of the interface of the application under test on the control end, generates an operation event queue, and obtains the first system log generated by the control end; in the present invention, the operation events of the user on the control end will be collected for subsequent sending to multiple connected client ends for testing these operations. Among them, the operation events include each click, long press, swipe, text input, back key, Home key and other events. Of course, in another optional implementation manner of the present invention, it is also possible to send an operation event to the multiple client ends connected to the control end for simulated execution every time an operation event is obtained; the content recorded in the first system log includes UI adaptation problems, operation logs, crash logs, ANR logs, CPU occupancy, memory occupancy, power consumption, etc. of the application during the test:

[0057] S500 sends the operation event queue to multiple client ends through the data transmission channel between the control end and the client ends; in the present invention, after all the test operation events are collected, the control end will automatically trigger the sending of each operation event in the operation event queue to multiple client ends. Here, the method for determining whether the operation events are completely collected is that if no new operation events are monitored on the device within a certain period of time, it is considered that all operation events have been tested, or when the number of operation events in the queue meets the preset number, the control end is triggered to send each operation event in the operation event queue to the client ends;

[0058] S600 calls the accessibility service in the client end to simulate each operation in the operation event queue and obtains the second system log generated by the client end; the accessibility service is a set of system-level APIs that can simulate operations. After the user agrees to grant the application the permission to obtain the accessibility service, it can simulate operations to control the user's device, so that the user's device executes the operation events sent by the control end;

[0059] S700 sends back the second system log set generated by the client end to the control end, and summarizes the first system log and the second system log in the control end to obtain a test report. In the present invention, the second system logs corresponding to different client ends in the test report are listed separately, which is convenient for subsequent analysis of the running status of the application on different devices.

[0060] In an optional implementation manner of the first aspect of the present invention, taking one of the multiple devices to be compatibility tested as the control end, and the remaining devices to be compatibility tested as client ends, establishing a one-to-many connection between the control end and multiple client ends through the operation panel interface includes:

[0061] Open the application under test on the control end and enter the operation panel interface of the prefabricated test tool; start the ServerSocket connection service with a fixed IP address and port number in the operation panel interface of the control end; open the application under test on the client and enter the operation panel interface of the prefabricated test tool; click to connect to the Socket in the operation panel interface of the client to complete the communication connection between the client and the control end.

[0062] Specifically, take one device as the control end and the remaining devices as clients for one-to-many socket connection. The control end and the clients operate and connect in their respective operation panels (as shown in the example Figure 2 shown). The steps are as follows: The control end clicks the ServerSocket button to start a ServerSocket with a fixed IP address and port number. When the color of the status icon on the right changes to green, it indicates that the opening is successful, and then it waits for multiple clients to connect. The connected devices will be added to the list of connected devices. The remaining devices, as clients, click the connect socket button to connect to the ServerSocket service of the control end. Similarly, when the color of the status icon on the right changes to green, it indicates that the connection is successful. When the control end receives a connection from each client, it starts a thread to communicate with the socket of that client specifically. After all devices are connected, click the configuration complete button on the operation panel to enter the home page of the app under test. The test engineer uses the control end device for manual testing, and all client devices are synchronously controlled.

[0063] In the present invention, the operation panel interfaces of the control end and the client can be the same (that is, the prefabricated test tools installed in each device have the functions of both the control end and the receiving end). When the user selects to click the ServerSocket button in one device, the identity of this device will automatically become the control end. When other devices click the connect socket button, they will automatically search and discover the control end that has started the ServerSocket service in the network and establish a communication connection with it. In the present invention, the network environment used by the control end and the client can be such that all clients can be connected to the network created by the control end. Of course, it can also be that the control end and multiple clients are connected to the network issued by another device (such as a router).

[0064] In an optional implementation manner of the first aspect of the present invention, the step of clicking to connect to the Socket in the operation panel interface of the client to complete the communication connection between the client and the control end includes:

[0065] When the control end receives a Socket connection request sent by each client, a new data transmission channel and a new data processing thread will be enabled to process the data transmission between the control end and the client, and the client will be added to the list of connected devices. In the present invention, each client and the control end transmit data through different data transmission channels and threads respectively, which can improve the data transmission efficiency, avoid errors in the data transmission process, and facilitate the later distinction of the sources of the obtained system logs.

[0066] In an optional implementation manner of the first aspect of the present invention, opening the application under test in the control end and entering the operation panel interface of the prefabricated test tool, and opening the application under test in the client and entering the operation panel interface of the prefabricated test tool include:

[0067] Open the application under test to generate a window requesting accessibility service; after the request for accessibility service is permitted, enter the operation panel interface of the prefabricated test tool, and at the same time, a semi-transparent floating window for displaying real-time device status information is generated at the corner of the operation panel interface. In the present invention, since controlling multiple devices by one device is realized through the accessibility service, when entering the application under test, the permission to call the accessibility service needs to be granted first to ensure the normal operation of the functions of the application under test. The data displayed in the semi-transparent floating window of the present invention are mainly parameters such as the CPU occupancy, memory occupancy, and power consumption of the device. The update frequency unit of these data is seconds, and further, they are divided into three levels: low, medium, and high according to a predetermined threshold. When the data of these parameters are in different threshold intervals, different colors are displayed in the floating window, and the test engineer can monitor the performance warning at any time according to the color change of the floating window.

[0068] In an optional implementation manner of the first aspect of the present invention, listening to the operations of the user on the various-level interfaces of the application under test on the control end, generating an operation event queue, and obtaining the first system log generated by the control end include:

[0069] Listen to the operations of the user on the various-level interfaces of the application under test on the control end; in the present invention, after the connection is established, closing the operation panel interface can directly enter the interface of the application, and then the user can test the application.

[0070] Upon monitoring an operation event, the operation event is added to the head of the operation event queue through a pre-set queue addition function; in this step, when the user operates the app under test on the control end, the system monitors each event such as click, long press, swipe, text input, return key, Home key, etc., and adds each event to the queue. The Queue.offer() function defined in Java is used to add an event to the head of the operation event queue;

[0071] After monitoring the end of the operation, the first system log generated by the control end during the operation period is obtained from the log storage address of the control end.

[0072] In an optional implementation manner of the first aspect of the present invention, sending the operation event queue to multiple clients through the data transmission channel between the control end and the client includes:

[0073] Traverse each client connected to the control end;

[0074] Use a pre-set queue retrieval function to retrieve one operation event from the tail of the operation event queue each time; in this step, traverse all clients, retrieve one operation event from the operation event queue each time, and then send it to each client device in sequence through the corresponding data transmission channel. The Queue.poll() function in Java is used to retrieve the last operation event from the tail and remove it from the operation event queue;

[0075] Send the retrieved operation events to each client in the traversal order until all the operation events in the operation event queue are sent to each client. After receiving the operation event, the client device parses each event in a fixed json format. The json field contains the key information of the event (event type, control properties, coordinates of gesture operations, etc.). Similarly, each operation event received by the client is also added to the queue to be simulated and executed in the client device. After all events are received, one operation event is taken from the queue to be simulated and executed each time to obtain the same operation execution effect as the control end.

[0076] Embodiment

[0077] Generally speaking, a complete embodiment process of an exemplary aspect of the present invention is as follows:

[0078] S1: Integrate the core code library of the test tool (including the permission application module, the socket connection communication module for the control end and the client, the accessibility service module, the log output module, and a simple operation page) into the app under test and install it on all devices that need to be tested. Grant the accessibility permission and the floating window permission. The specific process of step S1 is as follows:

[0079] 1. In the project code of the app under test, inject the core code library into the app program through the following dependency statement and package it into the apk file as part of the program:

[0080] implementation project(path:':Components:Test')

[0081] 2. Start the app under test and jump to the pre-test configuration panel page for pre-test preparation and configuration, including granting necessary permissions and establishing a socket connection;

[0082] 3. After entering the test component page, request the accessibility service permission and click Allow. At this time, the Android system will automatically start the accessibility service pre-registered in the test component. When the following events occur on the device screen, the Android system will encapsulate the attributes of the event, including the event type, the attributes of the control being operated (such as the id, coordinates, and text content of the text or button), and the control tree hierarchy of the current screen, into the event object in the following code and send it to the accessibility service:

[0083] override fun onAccessibilityEvent(event:AccessibilityEvent){

[0084] when(event.eventType){

[0085] AccessibilityEvent.TYPE_VIEW_CLICKED->{} / / Receive a click event on the screen

[0086] AccessibilityEvent.TYPE_VIEW_LONG_CLICKED->{} / / Receive a long click event on the screen

[0087] AccessibilityEvent.TYPE_VIEW_SCROLLED->{} / / Receive a scroll event on the screen

[0088] AccessibilityEvent.TYPE_VIEW_SELECTED->{} / / Receive a selection event on the screen

[0089] AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED -> {} / / Receive the event of text change in the input box on the screen

[0090] AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED -> {} / / Screen element update

[0091] AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED -> {} / / Screen page switching

[0092] AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_START -> {} / / Receive the start of the touch gesture event

[0093] AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_END -> {} / / Receive the end of the touch gesture event

[0094] 4. Request the floating window permission and click Allow. At this time, a semi - transparent floating window is created and displayed in the upper - right corner of the screen, which is used to display the status information of the device in real - time during the test process and provide early warning prompts.

[0095] S2: Take one device as the control end and the rest of the devices as the client ends, and perform a one - to - many socket connection. The control end and the client ends operate and connect on their respective operation panels. Steps:

[0096] The control end uses a fixed IP address and port number, clicks the button to start a ServerSocket, and the green status icon on the right shows that the start is successful. Then it waits for multiple client connections, and the connected devices will be appended to the list of connected devices;

[0097] The rest of the devices act as client ends, click the button to connect to the socket of the control end, and the green status icon on the right shows that the start is successful. Every time the control end receives a connection from a client, it starts a thread to communicate specifically with the socket of that client;

[0098] S3: After all devices are connected, click the configuration completion button on the operation panel to enter the home page of the app to be tested. The test engineer uses the control - end device for manual testing, and all client - end devices are synchronously controlled:

[0099] The app to be tested on the operation control end. The accessibility service monitors every click, long press, swipe, text input, back key, Home key, and other events, and adds each event to a queue. Using the Java Queue.offer() function will add an element to the head of the queue;

[0100] Traverse all client sockets, take out the events in the queue, and send them to the client device in order through the socket. Using the Java Queue.poll() function will take out the last element from the tail and remove it from the queue;

[0101] 3: After the client device receives the event, parse each event in a fixed json format. The json fields contain the key information of the event (event type, control properties, coordinates of gesture operations, etc.), and similarly add them to the queue;

[0102] 4. Continuously take out the events in the queue in order, and through the Android accessibility service, simulate the response of the events on the client device to achieve wireless synchronous control of multiple client devices by the control device;

[0103] node.performAction(AccessibilityNodeInfo.ACTION_CLICK) / / Simulate the response to the click event

[0104] node.performAction(AccessibilityNodeInfo.ACTION_LONG_CLICK) / / Simulate the response to the long click event

[0105] node.performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, bundle) / / Simulate the response to the event of setting the text in the input box

[0106] node.performAction(AccessibilityNodeInfo.ACTION_SET_SELECTION) / / Simulate the response to the selection event

[0107] node.performAction(AccessibilityNodeInfo.ACTION_CLEAR_SELECTION) / / Simulate the response to the deselection event

[0108] performGlobalAction(GLOBAL_ACTION_BACK) / / Simulate the response to the back key event

[0109] performGlobalAction(GLOBAL_ACTION_HOME) / / Simulate the event of pressing the Home key

[0110] node.performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD) / / Simulate the response of swiping down

[0111] node.performAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD) / / Simulate the response of swiping up

[0112] S4: During the operation test, the client device continuously listens and collects UI adaptation problems, operation logs, crash logs, ANR logs, CPU occupancy, memory occupancy, and power consumption in the test process: (Monitoring items)

[0113] S5: Update the CPU occupancy, memory occupancy, and power consumption to the floating window of the client device every second. According to the predetermined threshold, it is divided into three levels: low, medium, and high, and different colors are displayed in the floating window. The test engineer can monitor the performance warning at any time according to the color change of the floating window;

[0114] S6: After the test is completed, the test engineer ends the test on the control device and sends an end signal to all clients. After each client receives the signal, it sends and aggregates the locally generated logs and test reports to the control device through the socket, and the test report can be exported through the control device.

[0115] In the present invention, the test tool is injected into the application program through a line of code dependency, achieving light weight. Then, through a one-to-many socket connection, one-to-many communication and synchronization are achieved. By listening and responding to events through the accessibility service, synchronous control is achieved. Real-time logging and warning of each client achieve real-time visual monitoring. By using the method of the present invention, the test component is injected into the program through a line of code dependency, which can be decoupled at any time when in use, and is very light. One-to-many communication and control are realized through the socket and the accessibility service, saving the repetitive work of multi-device compatibility testing, eliminating the need to write fixed scripts and repeatedly optimize scripts, visually controlling the operation of test cases, covering more compatibility problems, and automatically recording and generating test reports.

[0116] See Figure 3 , the second aspect of the present invention provides a multi-device compatibility test system for an application program. The multi-device compatibility test system for the application program includes:

[0117] The test tool integration module 10 is used to integrate the prefabricated test tool into the installation package of the application under test, so that after the application under test is clicked to open, it first enters the operation panel interface of the prefabricated test tool;

[0118] The software installation module 20 is used to install the application integrated with the prefabricated test tool into multiple devices to be compatible tested;

[0119] The device connection module 30 is used to take one of the multiple devices to be compatible tested as the control end, and the remaining devices to be compatible tested as the client ends, and establish a one-to-many connection between the control end and the multiple client ends through the operation panel interface;

[0120] The operation event monitoring module 40 is used to monitor the operations of the user on each interface of the application under test on the control end, generate an operation event queue, and obtain the first system log generated by the control end;

[0121] The operation event queue sending module 50 is used to send the operation event queue to the multiple client ends through the data transmission channel between the control end and the client ends;

[0122] The operation event simulation execution module 60 is used to call the accessibility service in the client end to simulate the operations in the operation event queue, and obtain the second system log generated by the client end;

[0123] The report summary module 70 is used to return the second system log set generated by the client end to the control end, and summarize the first system log and the second system log in the control end to obtain a test report.

[0124] In an optional implementation manner of the second aspect of the present invention, the device connection module 30 includes:

[0125] The control end operation unit is used to open the application under test in the control end and enter the operation panel interface of the prefabricated test tool; start the ServerSocket connection service with a fixed IP address and port number in the operation panel interface of the control end;

[0126] The client end operation unit is used to open the application under test in the client end and enter the operation panel interface of the prefabricated test tool; click to connect to the Socket in the operation panel interface of the client end to complete the communication connection between the client end and the control end.

[0127] In an optional implementation manner of the second aspect of the present invention, the device connection module 30 further includes:

[0128] The data channel and thread allocation unit is used to enable a new data transmission channel and a new data processing thread to process the data transmission between the control end and the client each time the control end receives a Socket connection request sent by the client, and add the client to the connected device list.

[0129] In an optional implementation of the second aspect of the present invention, the control end operation unit and the client operation unit both include:

[0130] an accessibility service request window generating subunit, configured to open the application to be tested and generate a window for requesting accessibility service;

[0131] The device status floating window generating subunit is used to enter the operation panel interface of the prefabricated test tool after the accessibility service request is allowed, and generate a semi-transparent floating window in the corner of the operation panel interface for displaying the real-time status information of the device.

[0132] In an optional implementation of the second aspect of the present invention, the operation event monitoring module 40 includes:

[0133] A monitoring unit, configured to monitor the user's operations on the control terminal on various interfaces of the application to be tested;

[0134] An event adding unit, configured to add an operation event to the head of the operation event queue through a preset queue adding function each time an operation event is monitored;

[0135] The log acquisition unit is used to acquire the first system log generated by the control terminal during the operation period from the log storage address of the control terminal after monitoring the end of the operation.

[0136] In an optional implementation of the first aspect of the present invention, the operation event queue sending module 50 includes:

[0137] A traversal unit, configured to traverse each of the clients connected to the control terminal;

[0138] An event fetching unit, configured to fetch one operation event from the tail of the operation event queue each time using a preset queue fetching function;

[0139] The event sending unit is used to send the retrieved operation events to each of the clients in sequence according to the traversal order until all the operation events in the operation event queue are sent to each of the clients.

[0140] In an alternative embodiment of the second aspect of the present invention, the prefabricated test tool includes a permission application module, a socket connection communication module for the control end and the receiving end, a barrier-free service module, a log output module, and the operation panel interface.

[0141] Figure 4 FIG. 4 is a schematic diagram of a multi-device compatible test device for an application program provided by an embodiment of the present invention. The multi-device compatible test device for an application program may vary greatly due to different configurations or performances, and may include one or more processors 90 (central processing units, CPU) (for example, one or more processors) and a memory 100, and one or more storage media 110 (for example, one or more mass storage devices) for storing application programs or data. Among them, the memory and the storage medium may be transient storage or persistent storage. The program stored in the storage medium may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the multi-device compatible test device for an application program. Further, the processor may be set to communicate with the storage medium and execute a series of instruction operations in the storage medium on the medical tablet.

[0142] The multi-device compatible test device for an application program of the present invention may further include one or more power supplies 120, one or more wired or wireless network interfaces 130, one or more input / output interfaces 140, and / or one or more operating systems, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and so on. Those skilled in the art can understand that Figure 4 the structure of the multi-device compatible test device for an application program shown in the figure does not constitute a specific limitation on the multi-device compatible test device for an application program of the present invention, and may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements.

[0143] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a computer, the computer is caused to execute the steps of the multi-device compatible test method for an application program.

[0144] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described system or device and unit can refer to the corresponding processes in the foregoing method embodiments and will not be described herein again.

[0145] When the integrated unit is implemented in the form of a software functional unit 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 the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing 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 the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0146] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for multi-device compatibility testing of application programs, characterized in that, Including the following steps: Integrate a prefabricated test tool into the installation package of the application under test, so that after the application under test is clicked to open, it first enters the operation panel interface of the prefabricated test tool; Install the application integrated with the prefabricated test tool into multiple devices to be compatible tested; Select one of the multiple devices to be compatible tested as the control end, and the remaining devices to be compatible tested as the client ends, and establish a one-to-many connection between the control end and the multiple client ends through the operation panel interface; Monitor the operations of the user on each interface of the application under test on the control end, generate an operation event queue, and obtain the first system log generated by the control end; Send the operation event queue to the multiple client ends through the data transmission channel between the control end and the client ends; Call the accessibility service in the client end to simulate each operation in the operation event queue, and obtain the second system log generated by the client end; Collect and transmit the second system log generated by the client end back to the control end, and summarize the first system log and the second system log in the control end to obtain a test report.

2. The application program multi-device compatibility test method according to claim 1, characterized in that The step of selecting one of the multiple devices to be compatible tested as the control end, and the remaining devices to be compatible tested as the client ends, and establishing a one-to-many connection between the control end and the multiple client ends through the operation panel interface includes: Open the application under test in the control end and enter the operation panel interface of the prefabricated test tool; Start the ServerSocket connection service with a fixed IP address and port number in the operation panel interface of the control end; Open the application under test in the client end and enter the operation panel interface of the prefabricated test tool; Click to connect to the Socket in the operation panel interface of the client end to complete the communication connection between the client end and the control end.

3. The application program multi-device compatibility test method according to claim 2, characterized in that The step of clicking to connect to the Socket in the operation panel interface of the client end to complete the communication connection between the client end and the control end includes: When the control end receives each Socket connection request sent by the client end, it will enable a new data transmission channel and a new data processing thread to handle the data transmission between the control end and the client end, and add the client end to the list of connected devices.

4. The application program multi-device compatibility test method according to claim 2, wherein The steps of opening the application under test in the control end and entering the operation panel interface of the prefabricated test tool and opening the application under test in the client end and entering the operation panel interface of the prefabricated test tool include: Open the application under test to generate a window requesting the accessibility service; After the request for the accessibility service is allowed, enter the operation panel interface of the prefabricated test tool, and at the same time, generate a semi-transparent floating window for displaying the real-time status information of the device at the corner of the operation panel interface.

5. The application program multi-device compatibility testing method according to claim 4, wherein Listening to the operations of the monitored user on each level interface of the application under test on the control end, generating an operation event queue, and obtaining the first system log generated by the control end includes: Listening to the operations of the monitored user on each level interface of the application under test on the control end; Every time an operation event is monitored, adding the operation event to the head of the operation event queue through a preset queue addition function; After monitoring the end of the operation, obtaining the first system log generated by the control end during the operation period from the log storage address of the control end.

6. The application program multi-device compatibility testing method according to claim 5, wherein Sending the operation event queue to multiple clients through the data transmission channel between the control end and the client includes: Traversing each client connected to the control end; Using a preset queue extraction function to extract one operation event from the tail of the operation event queue each time; Sending the extracted operation events to each client in the traversal order until all the operation events in the operation event queue are sent to each client.

7. The application program multi-device compatibility test method according to claim 1, characterized in that The prefabricated test tool includes a permission application module, a socket connection communication module for the control end and the client, an accessibility service module, a log output module, and the operation panel interface.

8. An application multi-device compatibility testing system, characterized in that, The application multi-device compatibility test system includes: A test tool integration module for integrating the prefabricated test tool into the installation package of the application under test, so that after the application under test is clicked and opened, it first enters the operation panel interface of the prefabricated test tool; A software installation module for installing the application integrated with the prefabricated test tool into multiple devices to be tested for compatibility; A device connection module for taking one of the multiple devices to be tested for compatibility as the control end, and the remaining devices to be tested for compatibility as clients, and establishing a one-to-many connection between the control end and multiple clients through the operation panel interface; An operation event listening module for listening to the operations of the monitored user on each level interface of the application under test on the control end, generating an operation event queue, and obtaining the first system log generated by the control end; An operation event queue sending module for sending the operation event queue to multiple clients through the data transmission channel between the control end and the client; An operation event simulation execution module for calling the accessibility service in the client to simulate the operations in the operation event queue and obtaining the second system log generated by the client; A report summary module for sending back the second system log set generated by the client to the control end, and summarizing the first system log and the second system log in the control end to obtain a test report.

9. An application multi-device compatibility testing device, characterized in that, The application multi-device compatibility test device includes: a memory and at least one processor, instructions are stored in the memory, and the memory and the at least one processor are interconnected by a line; The at least one processor invokes the instructions in the memory, so that the application multi-device compatibility testing device executes the application multi-device compatibility testing method according to any one of claims 1-7.

10. A computer-readable storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, it implements the application multi-device compatibility testing method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Test tool resource management method and system based on cloud platform

    CN109783348A

  • Integrated test management platform for FPGA (Field Programmable Gate Array) test tool

    CN113706110A