Touch screen testing method, device and system, diagnosis system and readable storage medium

By parsing the test commands of touch screen controls and searching for target controls layer by layer, the problem of insufficient comprehensiveness and accuracy in touch screen testing is solved, and comprehensive and accurate automatic testing of touch screen controls is achieved.

CN121996480APending Publication Date: 2026-05-08SONOSCAPE MEDICAL (WUHAN) CORP
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SONOSCAPE MEDICAL (WUHAN) CORP
Filing Date
2024-11-07
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In existing technologies, touch screen testing is not comprehensive or accurate enough, and cannot cover the need for dynamically adjusting the position of controls, nor can it determine whether the current position is the desired control and the desired state.

Method used

By obtaining the test commands of the touch screen controls, parsing the control path, searching for the target control layer by layer, and sending the operation events to the ultrasound main program, the test results are determined by receiving the response results.

Benefits of technology

It enables comprehensive and accurate automated testing of touchscreen controls, improving the convenience and reliability of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121996480A_ABST
    Figure CN121996480A_ABST
Patent Text Reader

Abstract

The invention discloses a touch screen testing method, device and system, a diagnosis system and a readable storage medium, a touch screen is connected with an ultrasonic host, the ultrasonic host is configured with an ultrasonic main program, and the method comprises the following steps: obtaining a testing command for a touch screen control, and analyzing the testing command to obtain a control path; performing layer-by-layer searching by utilizing the control path so as to determine a target control to be tested in a page of the touch screen; sending an operation event for operating the target control to the ultrasonic main program, and receiving a response result returned by the ultrasonic main program for the operation event; and determining a test result of the target control based on the response result. The method and the device have the technical effects that the touch screen control in the touch screen can be comprehensively, accurately and automatically tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer application technology, and in particular to touch screen testing methods, apparatus, systems, diagnostic systems, and readable storage media. Background Technology

[0002] Medical ultrasound diagnostic systems typically include a main display and a touchscreen. The main display shows ultrasound images, while the touchscreen is used for human-computer interaction. The touchscreen provides a graphical user interface (GUI) for adjusting image parameters, switching image modes, selecting measurement parameters, and other operations to control and manipulate the ultrasound images.

[0003] Automated testing of ultrasound diagnostic systems plays a crucial role in product stability and rapid verification. A testing plan for touchscreens in ultrasound diagnostic systems mainly includes:

[0004] This approach simulates user clicks at corresponding coordinates on the touchscreen to trigger button operations. It requires determining the coordinates of specific controls when writing test scripts. However, this method necessitates defining the coordinates of specific controls during test case writing. Consequently, if the interface is adjusted or the control's position changes, the corresponding test cases must be modified, and it cannot cover the need for dynamically adjusted control positions. Furthermore, since it only writes events at the corresponding coordinates, it cannot determine whether the current position corresponds to the desired control and state. Additionally, due to the large number of controls on a touchscreen, this method cannot adequately cover all possible operation paths, resulting in incomplete and inaccurate touchscreen testing.

[0005] In conclusion, the lack of comprehensiveness and accuracy in touchscreen testing is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] The purpose of this application is to provide a touch screen testing method, apparatus, system, diagnostic system, and readable storage medium, which can perform comprehensive and accurate automatic testing of touch screen programs in a touch screen.

[0007] To solve the above-mentioned technical problems, this application provides the following technical solution:

[0008] A touchscreen testing method, wherein the touchscreen is connected to an ultrasound host, the ultrasound host being configured with an ultrasound main program, the method comprising:

[0009] Obtain the test commands for the touchscreen control, parse the test commands, and obtain the control path;

[0010] The target control to be tested is determined by searching layer by layer using the control path within the touchscreen page.

[0011] The operation event that manipulates the target control is sent to the ultrasound main program, and the response result returned by the ultrasound main program for the operation event is received;

[0012] The test result of the target control is determined based on the response result.

[0013] For example, before sending the operation event that manipulates the target control to the ultrasound main program, the method further includes:

[0014] The target control is simulated to perform the corresponding target operation, and the operation event is obtained.

[0015] For example, simulating the execution of a corresponding target operation on the target control includes:

[0016] The executable program corresponding to the target control is invoked to perform the target operation on the target control; wherein the target operation includes at least one of the following: a click operation and a page turning operation.

[0017] For example, sending an operation event that manipulates the target control to the ultrasound main program includes:

[0018] The operation event is written to the system file corresponding to the ultrasound main program.

[0019] For example, using the control path to perform a layer-by-layer search to determine the target control to be tested within the touchscreen page includes:

[0020] Obtain the control object tree of the touch screen; wherein the control object tree contains at least one of the following names: main page name and function page name, and also contains control names;

[0021] Following the control path, search layer by layer in the control object tree until the control object corresponding to the end point of the control path is found;

[0022] The found control object is identified as the target control.

[0023] For example, before obtaining the control object tree of the touchscreen, the method further includes:

[0024] When loading and displaying pages and controls, obtain the page name and control name; wherein, the page includes at least one of the main page and function pages;

[0025] Based on the page name, control name, and the hierarchical relationship between the page and the control, the corresponding object names are set in the tree topology to obtain the control object tree.

[0026] For example, determining the test result of the target control based on the response result includes:

[0027] Analyze the response results to obtain the display attributes corresponding to the target control;

[0028] If the display attribute matches the operation corresponding to the target control, the test result is determined to be normal.

[0029] For example, determining the test result of the target control based on the response result further includes:

[0030] If the display attribute does not match the operation corresponding to the target control, the test result is determined to be abnormal, and an abnormal prompt message is output based on the state of the target control; wherein, the abnormal prompt message includes at least one of the following: the control does not exist and the control is currently disabled.

[0031] For example, obtaining test commands for a touchscreen control includes:

[0032] The system iterates through the controls on the touchscreen page. If the current control has not completed testing, the system retrieves the test command corresponding to the current control, continuing until the iteration ends.

[0033] A touchscreen testing device, wherein the touchscreen is connected to an ultrasound host, the ultrasound host is configured with an ultrasound main program, and the device includes:

[0034] The command parsing unit is used to obtain test commands for touch screen controls and parse the test commands to obtain the control path;

[0035] The control determination unit is used to perform a layer-by-layer search using the control path to determine the target control to be tested from within the page of the touch screen.

[0036] An operation response unit is used to send an operation event that operates on the target control to the ultrasound main program, and to receive the response result returned by the ultrasound main program in response to the operation event;

[0037] The result determination unit is used to determine the test result of the target control based on the response result.

[0038] A touchscreen testing system, comprising:

[0039] The touch screen and the ultrasound host are provided, wherein the ultrasound host is equipped with an ultrasound main program and the touch screen is embedded with a test server.

[0040] The test server is used to implement the touchscreen test method described above.

[0041] For example, the testing system further includes a testing client, and the testing server includes a testing service module and a control operation module; the testing service module communicates with the testing client over the network.

[0042] The test service module is used to receive test requests sent by the test client, parse the test requests, obtain test commands, send the test commands to the control operation module, and when it detects an operation event of the control operation module operating the target control to be tested, send the operation event to the ultrasound main program, receive the response result returned by the ultrasound main program for the operation event, determine the test result of the target control based on the response result, and send the test result to the test client.

[0043] The control operation module is used to parse the test command, obtain the control path, and use the control path to perform a layer-by-layer search to determine the target control to be tested from within the touch screen page; and generate operation events to operate on the target control.

[0044] For example, the test server further includes: a page and control data acquisition module and a control path setting module; the page and control data acquisition module interacts with the ultrasound main program;

[0045] The page and control data acquisition module is used to acquire the page type and control information of the current page from the ultrasound main program.

[0046] The control path setting module is used to obtain the page type and control information from the page and control data acquisition module, and generate the page name and control name; wherein, the page name and control name are used to generate the control path.

[0047] An ultrasound diagnostic system, comprising:

[0048] An ultrasound host and a touch screen; the ultrasound host is equipped with an ultrasound main program; the touch screen is embedded with a touch screen program;

[0049] The ultrasound main program is used to communicate and interact with the touch screen program.

[0050] The touchscreen program is used to implement the touchscreen testing method described above.

[0051] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the touchscreen testing method described above.

[0052] Using the method provided in the embodiments of this application, the touch screen is connected to the ultrasound host, and the ultrasound host is configured with an ultrasound main program. The method includes: obtaining test commands for touch screen controls and parsing the test commands to obtain control paths; using the control paths to perform a layer-by-layer search to determine the target control to be tested from within the touch screen page; sending operation events that operate on the target control to the ultrasound main program and receiving the response results returned by the ultrasound main program for the operation events; and determining the test results of the target control based on the response results.

[0053] After obtaining the test command for the touchscreen control, the path of the control to be tested can be obtained by parsing the test command. By searching layer by layer using the control path, the target control to be tested can be identified from the touchscreen page. Then, the operation event of the target control is sent to the ultrasound main program, and the response returned by the ultrasound main program for the operation event is parsed. Based on the response result, the test result of the target control can be determined. In this application, the test process, by parsing the test command to obtain the control path and then locating the target control to be tested, allows for the location of any control on the page, enabling comprehensive testing of touchscreen controls. Simultaneously, the two-way interactive communication between the touchscreen and the ultrasound main program can be examined, and the response of the target control within the touchscreen controls can be observed. Moreover, the test result is determined directly based on the response result, which is more convenient and reliable than manually viewing the interface.

[0054] The technical effect of this application is that it enables comprehensive and accurate automatic testing of touch screen controls in a touch screen.

[0055] Accordingly, embodiments of this application also provide a touch screen testing device, a touch screen testing system, an ultrasound diagnostic system, and a readable storage medium corresponding to the above-described touch screen testing method, which have the aforementioned technical effects, and will not be elaborated further here. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1 This is a flowchart illustrating the implementation of a touchscreen testing method in an embodiment of this application.

[0058] Figure 2 This is a schematic diagram of some controls in a touchscreen page according to an embodiment of this application;

[0059] Figure 3 This is a schematic diagram illustrating a control name setting process in one embodiment of this application;

[0060] Figure 4 This is a schematic diagram of a control object tree in an embodiment of this application;

[0061] Figure 5 This is a schematic diagram of a path traversal in an embodiment of this application;

[0062] Figure 6 This is a schematic diagram of the structure of a touch screen testing device according to an embodiment of this application;

[0063] Figure 7 This is a schematic diagram of a touchscreen testing system according to an embodiment of this application;

[0064] Figure 8 This is a flowchart illustrating a specific implementation of a touchscreen testing method in this application.

[0065] Figure 9 This is a schematic diagram of an ultrasound diagnostic system according to an embodiment of this application;

[0066] Figure 10 This is a flowchart illustrating a specific implementation of a touchscreen testing method in this application. Detailed Implementation

[0067] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0068] Please refer to Figure 1 , Figure 1 This is a flowchart of a touchscreen testing method according to an embodiment of this application. The method is applied to a touchscreen, specifically to the touchscreen program within the touchscreen. The touchscreen is connected to an ultrasound host, which is configured with an ultrasound main program. The method includes the following steps:

[0069] S001. Obtain the test command for the touch screen control, parse the test command, and obtain the control path.

[0070] After the touchscreen program obtains the test command for the touchscreen control, it first parses the test command to obtain the control path.

[0071] A test command is a command that specifies the operation and the control path. The format of the command can be: target operation("control path"). Based on the command format, the test command can be parsed to obtain the control path and the target operation.

[0072] Based on the control path, the target control to be tested can be located layer by layer in the touchscreen application. The target operation can be the action that triggers the target control to be tested, such as a click, page turning, swiping, or character input, and the properties of the target control will change after the operation occurs.

[0073] For example, the test commands for click-type functions can be click(“PageTwoD / B”) or click(“PageTwoD / twoDTabPage / B”). Here, click means click, PageTwoD, twoDTabPage, and B refer to nodes / locations on the path, respectively. Specifically, PageTwoD represents the main page, twoDTabPage represents the function page, and B represents the specific control (i.e., the control that triggers the ultrasound device to achieve B-mode imaging).

[0074] For example, test commands can be obtained by receiving user-inputted test commands through an input interface, or by receiving test commands sent by a test client. Furthermore, test commands can be input by the user in real time, pre-configured, or automatically generated according to a certain algorithm.

[0075] S002. Use the control path to search layer by layer to determine the target control to be tested from within the touch screen page.

[0076] In this embodiment, the target control to be tested can be determined from within the touchscreen based on the control path. Specifically, each node / position in the control path can be analyzed layer by layer to determine the final target control.

[0077] In one specific embodiment of this application, a layer-by-layer search is performed using control paths to determine the target control to be tested within the touchscreen page, including:

[0078] Step 1: Obtain the control object tree of the touch screen; the control object tree contains at least one of the following names: main page name and function page name, and also contains control names;

[0079] Step 2: Search through the control object tree layer by layer according to the control path until the control object corresponding to the end of the control path is found;

[0080] Step 3: Identify the found control object as the target control.

[0081] The main page can be the interface displayed after the touchscreen is powered on. Based on the main page, specific ultrasound functions can be triggered or certain function pages can be accessed. Function pages can be opened through the main page, and there can be multiple function pages. Function pages are pages that implement specific functions, such as system settings pages, imaging function adjustment pages, and function control pages for cardiac scans, etc. Both the main page and function pages can contain at least one control. Therefore, the corresponding control can be found in the main page and / or function pages by searching layer by layer. For example, the control object tree can also contain the name of the display area in the page, and the display area can contain at least one control. That is, the page can contain the following hierarchical relationship: main page - function page - display area - control.

[0082] For ease of description, the above steps will be explained in combination below.

[0083] In this embodiment, a control object tree for the touchscreen can be pre-set, in which control objects have explicit names. Once the control path is determined, a search can be performed layer by layer in the control object tree until the control object corresponding to the endpoint in the control path is found, at which point the search ends. Then, the control object corresponding to the endpoint is identified as the target control. The target control can be any control on the touchscreen to be tested. The endpoint in the control path is the last address in the path, and this address corresponds to the target control to be tested.

[0084] like Figure 2 As shown, in Figure 2 Each small square represents a button (one button can correspond to one control), and the area surrounding each button represents a concentrated display area for a particular type of button. For example, in the above illustration, the 2D page is divided into two areas: an upper Tab area (navigation area) and a lower button area. In some cases, these areas can also serve as the controls being tested. It's important to note that the actual page will be more detailed than the actual page. Figure 2 Whether complex or simple, this is just an example and does not affect the actual process.

[0085] Figure 2In the code, PageTwoD 201, twoDTabPage 202, twoDButtonPage 203, B 204, Cine 205, ECG 206, Rotation 207, TGC 208, HI 209, Foc.Num 210, and Dyn Range 211 are the object names set for each control. These object names may or may not be displayed on the actual page; they are listed here only to illustrate how to determine the control object based on the control path. The object name is the name directly set for the UI object when the page data is received and the UI is constructed. Setting the object name using the display name facilitates test script writing.

[0086] Please refer to Figure 3 Before automated touchscreen testing, object names can be set for the corresponding pages and controls, and the controls can be identified through object name paths. For example, the main interface object name is `mainWindow`, the 2D mode page object name is `PageTwoD`, and there are buttons (LGC) on this page; then the path to the button LGC is `mainWindow / PageTwoD / LGC`. The control object name setting module will automatically set the corresponding object names based on the names when the page and controls are loaded and displayed, thus eliminating the need to modify other modules. Figure 3 In the process, the main ultrasound program first sends page loading data and control data to the touchscreen program. After receiving the page loading data and control data, the touchscreen program can set the object names for the page and controls based on the control object name setting module, and then display the page.

[0087] for Figure 2 The page shown has a corresponding control object tree that can be represented as follows: Figure 4 As shown. It should be noted that the actual control object tree is quite complex. Figure 4 The diagram has been simplified for illustrative purposes only and does not represent the final actual object tree. Here, "node" represents an unnamed node; buttons, pages, etc., are named and have explicit names. For example, the root node of the object control tree is "mainWindow," a custom-named term.

[0088] exist Figure 4 In the middle, the Rotation button also has child nodes LeftArea (to the left of the button) and RightArea (to the right of the button), because the Rotation button can be clicked on both sides. For example, clicking on the left half decreases the size, and clicking on the right half increases the size. Therefore, it has two named child nodes. The Foc. Num (vector control) and Dyn Range (dynamic range) controls are similar.

[0089] The TGC and HI controls are toggle buttons; clicking them once selects or deselects the item.

[0090] In this embodiment, a fuzzy search can be performed layer by layer until a matching control is found. That is, even if the control object tree has many levels and many unnamed nodes, it is not required that the control path and the level in the object tree correspond one-to-one, making it more flexible. For example, when the touchscreen receives the test command: click(“PageTwoD / B”) or click(“PageTwoD / twoDTabPage / B”), the search will first find the node matching “PageTwoD” layer by layer in the object tree, and then traverse the child nodes of that node until the corresponding test control is found. It can be seen that although these two control paths are different, the control ultimately found is the same.

[0091] In one specific embodiment of this application, before obtaining the control object tree of the touchscreen, the method further includes:

[0092] Step 1: When loading and displaying pages and controls, obtain the page name and control name; the page includes at least one of the main page and function pages;

[0093] Step 2: Based on the page name, control name, and the hierarchical relationship between the page and the control, set the corresponding object names in the tree topology to obtain the control object tree.

[0094] For ease of description, the two steps above will be explained together below.

[0095] To create a control object tree, you first need to obtain the name of at least one page from the main page and the functional pages, as well as the names of the controls within those pages. Then, based on the page names, control names, and the hierarchical relationship between pages and controls, you set the corresponding object names in the tree topology structure, thus obtaining the control object tree.

[0096] In other words, the control object tree presents the hierarchical relationship and topology of the page and controls in a tree structure.

[0097] S003. Send the operation event that operates on the target control to the ultrasound main program, and receive the response result returned by the ultrasound main program for the operation event.

[0098] Once the target control is identified, operation events that manipulate the target control can be sent to the ultrasound main program.

[0099] After receiving the operation event, the ultrasound main program will process the operation event and send the response result back to the touch screen program.

[0100] The operation event can be a response event generated by performing a corresponding control operation, or it can be an event message generated directly without any operation. The operation event only needs to represent the operation performed on the target control.

[0101] The response result can be display attribute information. Based on this information, the touchscreen can determine whether the properties of controls have changed or whether the page has changed. Display attributes refer to the characteristics of the page's displayed items (such as the overall page content, or the color, size, brightness, and value of a specific item within the page). For example, after a click, the page may flip; after operating a control, a certain area on the page may be highlighted. For instance, clicking the touchscreen could result in changes to controls such as changes in control parameters or states (highlighting), or changes to the page itself, such as page turning. When a page change occurs, the properties of the target control may not change, but the page's display attributes will.

[0102] After receiving the response result returned by the ultrasound main program for the operation event, the operation in step S004 can be executed.

[0103] In one specific embodiment of this application, before sending the operation event for manipulating the target control to the ultrasound main program, the method further includes: simulating the execution of the corresponding target operation on the target control to obtain the operation event. That is, the operation event can be generated by simulating the execution of the corresponding target operation on the target control. Here, simulation means that there is no actual user operation on the target control, but an automatic method is used to simulate a user performing a target operation on the target control.

[0104] During the execution of the target operation and the response of the target control, interactive information (operation events) is generated. These events can be sent to the main ultrasound program, which will then generate new data (i.e., response results) based on the interactive information and feed it back to the touchscreen. If the execution is error-free, the properties of the target control and / or the corresponding page will change due to the new data. This allows for the determination of the test status based on the displayed attribute information.

[0105] This includes simulating the execution of the corresponding target operation on the target control, including:

[0106] Invoke the executable program corresponding to the target control to perform the target operation on the target control; wherein the target operation includes at least one of the following: click operation and page turning operation.

[0107] When simulating target operations, various methods can be used to implement specific functions, and these methods can be invoked according to the configuration during execution.

[0108] In other words, it involves simulating the execution of a target operation on the target control, including calling the target control's operation methods (executing the program) to perform the target operation on the target control; where the target operation method corresponds to the target operation. That is, in practical applications, the target operation can be simulated by calling the operation methods of a specific UI control object.

[0109] In one embodiment of this application, simulating the execution of a target operation on a target control includes: writing an operation event to a system device file and performing the target operation on the target control; wherein the operation event corresponds to the target operation. A target operation is simulated by writing an operation event to the system device file. The operation event is the event that would be recorded in the system device file after a user performs a target operation under normal circumstances. Several types of operation-related events can be pre-recorded, and when a simulated operation is needed, the appropriate event is selected to be written to the system device file.

[0110] The following section explains the specific implementation methods for different target operations.

[0111] For the target operation being page turning, there are two simulation methods:

[0112] 1. Call a method of a specified page to set the current page number. For example, if there is a paginated area, twoDButtonSectionView, in a 2D scene page, you can call the incrementCurrentIndex method of this control to flip back one page.

[0113] 2. Simulate user clicks using mouse or touch events. For example, the steps are as follows:

[0114] ① Obtain the coordinates and dimensions of the twoDButtonSectionView;

[0115] ② Send a press event in the control area;

[0116] ③ Send a move event;

[0117] ④ Send the release event.

[0118] Similarly, for a target action like a button click, you can call the control's `click` property or simulate user action through events. After finding the corresponding control object, the click operation performed on it can be triggered by calling the control object's methods (provided by the UI framework) or by writing events to the system (such as writing mouse events to simulate a user click at that coordinate point).

[0119] The specific coordinates can be obtained through the object's properties, and this coordinate acquisition can be provided by the UI framework. For example, a touchscreen can trigger the ultrasound main program to obtain the corresponding coordinate information through the UI framework.

[0120] In one specific embodiment of this application, sending an operation event that manipulates the target control to the ultrasound main program includes:

[0121] Write operation events to the system file corresponding to the ultrasound main program.

[0122] That is, the method of sending operation events can be specifically to write operation events directly to the system file corresponding to the ultrasound main program.

[0123] S004. Determine the test results of the target control based on the response results.

[0124] In one specific embodiment of this application, determining the test result of the target control based on the response result includes:

[0125] Analyze the response results to obtain the display properties corresponding to the target control;

[0126] If the displayed properties match the operation corresponding to the target control, the test result is considered normal.

[0127] The display properties corresponding to the target control are the display properties of the control and / or the page caused by the operation events of the target control. That is, they can be the display properties of the target control or the display properties of the page where the target control is located.

[0128] For ease of description, the two steps above will be explained together below.

[0129] After obtaining the response result, the display properties corresponding to the target control can be obtained. If the display properties match the operation corresponding to the target control, the test result is normal; otherwise, it is abnormal.

[0130] For example, the command to retrieve the property value of a control is `get_property(control path, property value)`. One test case is to test the functionality of the Rotation buttons. Clicking the left half of the Rotation button once decreases the value by 10, and clicking the right half once increases it by 10. The test case would be as follows:

[0131] value1 =get_property(“pageTwoD / Dyn Range”, “Value”);

[0132] click("pageTwoD / Rotation / LeftArea");

[0133] value2 = get_property(“pageTwoD / Dyn Range”, “Value”);

[0134] check(value1 – 10 == value2);

[0135] The above test cases are explained as follows: First, the control property value is obtained as value1. After the main program executes the operation of clicking the left half of the Rotation once, it returns the response result. Then, the control property value is obtained again as value2. It is determined whether the difference between value1 and value2 is 10. If it is 10, it means that the test result of clicking the control on the left half of the Rotation is normal. If it is not 10, it means that the test result of clicking the control on the left half of the Rotation is abnormal.

[0136] It should be noted that the above use cases are for illustrative purposes only and do not represent actual scripts.

[0137] In one specific embodiment of this application, determining the test result of the target control based on the response result further includes:

[0138] If the displayed properties do not match the operation corresponding to the target control, the test result is determined to be abnormal, and an abnormal prompt message is output based on the state of the target control; wherein, the abnormal prompt message includes at least one of the following: the control does not exist and the control is currently disabled.

[0139] Specifically, when a mismatch is found between the display attributes and the corresponding operation of the target control, the test result is determined to be abnormal. In cases of abnormal test results, an exception message can be output based on the state of the target control. This exception message can be: the control does not exist, the control is currently disabled, or the control is either not present or disabled. For example, in button click testing, if a mismatch is found between the display attributes and the corresponding operation of the target control, information such as "button does not exist" or "button is currently disabled and cannot be clicked" can be output, thereby reducing the cost of problem localization.

[0140] In one embodiment of this application, obtaining test commands for a touchscreen control includes:

[0141] Iterate through the controls on the touchscreen page. If the current control has not been tested, retrieve the test command corresponding to the current control, until the iteration ends.

[0142] Please refer to Figure 5The test iterates through all operable paths by retrieving the current page and all buttons on it, thus identifying the controls corresponding to all traversable paths. Then, iterates through these controls, obtaining the test commands for those not yet tested, and performing tests in conjunction with the test cases, until the iteration is complete.

[0143] Using the method provided in the embodiments of this application, the touch screen is connected to the ultrasound host, and the ultrasound host is configured with an ultrasound main program. The method includes: obtaining test commands for touch screen controls and parsing the test commands to obtain control paths; using the control paths to perform a layer-by-layer search to determine the target control to be tested from within the touch screen page; sending operation events that operate on the target control to the ultrasound main program and receiving the response results returned by the ultrasound main program for the operation events; and determining the test results of the target control based on the response results.

[0144] After obtaining the test command for the touchscreen control, the path of the control to be tested can be obtained by parsing the test command. By searching layer by layer using the control path, the target control to be tested can be identified from the touchscreen page. Then, the operation event of the target control is sent to the ultrasound main program, and the response returned by the ultrasound main program for the operation event is parsed. Based on the response result, the test result of the target control can be determined. In this application, the test process, by parsing the test command to obtain the control path and then locating the target control to be tested, allows for the location of any control on the page, enabling comprehensive testing of touchscreen controls. Simultaneously, the two-way interactive communication between the touchscreen and the ultrasound main program can be examined, and the response of the target control within the touchscreen controls can be observed. Moreover, the test result is determined directly based on the response result, which is more convenient and reliable than manually viewing the interface.

[0145] To fully explain how test results are determined based on response results, the above touchscreen testing method will be explained in detail below with specific application scenarios as examples.

[0146] Please refer to Figure 10 The specific implementation process of this method includes:

[0147] S101. Obtain the test command and parse it to obtain the control path and target operation. The target operation is used to trigger the control and change its display properties.

[0148] S102. Use the control path to determine the target control to be tested from within the touch screen.

[0149] S103. Obtain the first display property information of the target control.

[0150] After identifying the target control, in order to achieve automated comparison testing, in this embodiment, the first display attribute information of the target control can be obtained before performing target operations on the target control.

[0151] It is important to note that, in order to distinguish between the display attribute information of the target control before and after the target operation, the display attribute information obtained before the target operation is performed on the target control is called the first display attribute information, and the display attribute information obtained after the target operation is performed on the target control is called the second display attribute information.

[0152] The ultrasound main program sends page data and control data to the touchscreen for processing and display. This data is cached in the ultrasound main program's data processing module. By interacting with this module, the display attribute information of the target control can be obtained. For example, this method can be used to obtain the current page type, all buttons displayed on the current page, and their attributes.

[0153] S104. Simulate the execution of the target operation on the target control to test the target control.

[0154] After identifying the target control and obtaining the first display property information of the target control on which the target operation has not been performed, the target operation can be simulated on the target control to test the target control.

[0155] In one embodiment of this application, a target operation is simulated on the target control to test the target control, including:

[0156] For the target control, simulate the execution of the target operation so that the target control responds to the target operation, generates interactive information, and sends the interactive information to the ultrasound main program;

[0157] Receive new display data fed back after the ultrasound main program processes and interacts with the information;

[0158] Use the new display data to update the display property information of the target control.

[0159] For ease of description, the above steps will be combined below.

[0160] Using technical means, the target control is simulated to perform a target operation. The target control responds to this operation by generating interactive information, which is then sent to the ultrasound main program.

[0161] After receiving the interactive information, the ultrasound main program processes it and generates new display data for the touchscreen. The ultrasound main program then sends the new display data to the touchscreen.

[0162] When the touchscreen program receives new display data, it updates the display attribute information of the target control based on the new display data.

[0163] It is important to note that the above response processing procedure refers to the response processing and display attribute information update process under the condition that the target control on the touchscreen is functioning normally. When the target control cannot respond normally or cannot interact with the main program, the display attribute information cannot be updated or will be updated inaccurately. Based on this, by combining the display attribute information before and after the target operation, it can be determined whether the target control is functioning normally (whether it passes the test).

[0164] S105. Obtain the second display property information of the target control.

[0165] After the target operation is completed, the second display property information of the target control can be obtained.

[0166] S106. Compare the first display attribute information and the second display attribute information to obtain the test result of the test command.

[0167] In practical applications, by comparing the first and second display attribute information, the changes resulting from simulating a target operation on the target control can be determined. For example, if the test command is to click a button, the display attribute information will change before and after the click, depending on the button's specific function. If this change conforms to the design, the button's function is normal; if the display attribute information does not change, or the change does not conform to the design, it indicates that the button's function is abnormal.

[0168] In one embodiment of this application, comparing the first display attribute information and the second display attribute information to obtain the test result of the test command includes:

[0169] Read the first target attribute related to the test command from the first displayed attribute information;

[0170] Read the second target attribute related to the test command from the second display attribute information;

[0171] Compare the first target attribute and the second target attribute to obtain the difference information;

[0172] Determine whether the discrepancy information matches the target operation;

[0173] If so, then the test result of the test command is determined to be successful;

[0174] If not, then the test result of the test command is determined to be execution failure.

[0175] For ease of description, the above steps will be combined below.

[0176] In practical applications, after a target operation is performed on a target control, the target properties related to the target operation in its display property information will show specific differences if the target control is functioning normally. In this application, this difference can be used to determine whether the test command was executed successfully.

[0177] Specifically, the first target attribute related to the test command can be read from the first display attribute information, and correspondingly, the second target attribute related to the test command can be read from the second display attribute information.

[0178] The first and second target attributes both correspond to the same attribute, occurring at different times before and after the target operation is performed.

[0179] The difference information can be determined based on the first target attribute and the second target attribute. If the difference information matches the target operation, the test command is determined to have been executed successfully; otherwise, the test command is determined to have failed.

[0180] In other words, by parsing the test command, the control path and target operation to be tested can be obtained. Based on the control path, the target control to be tested can be identified from the touchscreen. Then, the first display attribute information of the target control is obtained. After obtaining the first display attribute information, the target operation can be simulated to test the target control. After the test is completed, the second display attribute information of the target control can be obtained. During the execution of the target operation, the interactive information generated by the target control's response is sent to the main program. The main program generates new data based on the interactive information and feeds it back to the target control on the touchscreen. If the execution is error-free, the attributes of the target control will change due to the new data. Therefore, comparing the first and second display attribute information can determine the test result.

[0181] In this application, the bidirectional interactive communication between the touchscreen and the main program can be examined during the testing process and the response of the target control. Furthermore, the test results are determined directly based on the display attribute information corresponding to the target control, which is more convenient and reliable than manually viewing the interface. Therefore, this application can perform comprehensive and accurate automatic testing of touchscreen programs on a touchscreen.

[0182] Corresponding to the above method embodiments, this application also provides a touch screen testing device. The touch screen testing device described below can be referred to in correspondence with the touch screen testing method described above.

[0183] See Figure 6 As shown, the touchscreen is connected to the ultrasound host, which is equipped with an ultrasound main program. The device includes:

[0184] The command parsing unit 601 is used to obtain test commands for touch screen controls and parse the test commands to obtain the control path;

[0185] The control determination unit 602 is used to perform a layer-by-layer search using the control path to determine the target control to be tested from within the touch screen page;

[0186] The operation response unit 603 is used to send operation events that operate on the target control to the ultrasound main program, and to receive the response results returned by the ultrasound main program in response to the operation events.

[0187] Result determination unit 604 is used to determine the test result of the target control based on the response result.

[0188] Using the apparatus provided in the embodiments of this application, the touch screen is connected to the ultrasound host, and the ultrasound host is configured with an ultrasound main program. The method includes: obtaining test commands for touch screen controls and parsing the test commands to obtain control paths; using the control paths to perform a layer-by-layer search to determine the target control to be tested from within the touch screen page; sending operation events that operate on the target control to the ultrasound main program and receiving the response results returned by the ultrasound main program for the operation events; and determining the test results of the target control based on the response results.

[0189] After obtaining the test command for the touchscreen control, the path of the control to be tested can be obtained by parsing the test command. By searching layer by layer using the control path, the target control to be tested can be identified from the touchscreen page. Then, the operation event of the target control is sent to the ultrasound main program, and the response returned by the ultrasound main program for the operation event is parsed. Based on the response result, the test result of the target control can be determined. In this application, the test process, by parsing the test command to obtain the control path and then locating the target control to be tested, allows for the location of any control on the page, enabling comprehensive testing of touchscreen controls. Simultaneously, the two-way interactive communication between the touchscreen and the ultrasound main program can be examined, and the response of the target control within the touchscreen controls can be observed. Moreover, the test result is determined directly based on the response result, which is more convenient and reliable than manually viewing the interface.

[0190] The technical effect of this application is that it enables comprehensive and accurate automatic testing of touch screen controls in a touch screen.

[0191] In one specific embodiment of this application, it further includes:

[0192] The operation event acquisition unit is used to simulate the execution of the corresponding target operation on the target control before sending the operation event for operating the target control to the ultrasound main program, and obtain the operation event.

[0193] In one specific embodiment of this application, the operation event acquisition unit is specifically used to call the execution program corresponding to the target control to perform a target operation on the target control; wherein, the target operation includes at least one of the following: a click operation and a page turning operation.

[0194] In one specific embodiment of this application, the operation response unit is specifically used to write operation events to the system file corresponding to the ultrasound main program.

[0195] In one specific embodiment of this application, the control determination unit is specifically used to obtain the control object tree of the touch screen; wherein, the control object tree includes at least one of the following names: main page name and function page name, and also includes control names;

[0196] Search through the control object tree layer by layer according to the control path until the control object corresponding to the end of the control path is found.

[0197] The found control object is identified as the target control.

[0198] In one specific embodiment of this application, it further includes:

[0199] The control object tree construction unit is used to obtain the page name and control name when loading and displaying pages and controls before obtaining the control object tree of the touch screen; wherein, the page includes at least one of the main page and function pages; according to the page name and control name and the hierarchical relationship between the page and the control, the corresponding object name is set in the tree topology to obtain the control object tree.

[0200] In one specific embodiment of this application, the result determination unit is specifically used to analyze the response result and obtain the display attribute corresponding to the target control; if the display attribute matches the operation corresponding to the target control, the test result is determined to be normal.

[0201] In one specific embodiment of this application, it further includes:

[0202] An exception prompting unit is used to determine that the test result is abnormal if the display attribute does not match the operation corresponding to the target control, and to output an exception prompt message based on the state of the target control; wherein, the exception prompt message includes at least one of the following: the control does not exist and the control is currently disabled.

[0203] In one specific embodiment of this application, the command parsing unit is specifically used to traverse the controls on the touch screen page. If the current control has not completed the test, the test command corresponding to the current control is obtained until the traversal is completed.

[0204] Corresponding to the above method embodiments, this application also provides a testing system, which can be referred to in conjunction with the touch screen testing method described above.

[0205] Please refer to Figure 7 The testing system includes:

[0206] The touch screen 902 and the ultrasonic host 905 are equipped with an ultrasonic main program 903, and the touch screen has a test server 906 embedded in it.

[0207] The test server is used to implement the touchscreen testing methods described above.

[0208] The testing system also includes a test client, and the test server includes a test service module and a control operation module; the test service module communicates with the test client over the network.

[0209] The test service module is used to receive test requests sent by the test client, parse the test requests, obtain test commands, send the test commands to the control operation module, and when it detects an operation event of the control operation module performing an operation on the target control to be tested, it sends the operation event to the ultrasound main program, receives the response result returned by the ultrasound main program for the operation event, determines the test result of the target control based on the response result, and sends the test result to the test client.

[0210] The control operation module is used to parse test commands, obtain control paths, and use these paths to perform a layer-by-layer search to locate the target control to be tested within the touchscreen page; it also generates operation events to manipulate the target control.

[0211] The test server also includes: a page and control data acquisition module and a control path setting module; the page and control data acquisition module interacts with the ultrasound main program;

[0212] The page and control data acquisition module is used to obtain the page type and control information of the current page from the ultrasound main program;

[0213] The control path setting module is used to obtain page type and control information from the page and control data acquisition module, and generate page name and control name; the page name and control name are used to generate control path.

[0214] The test server is a separate module implemented within the touchscreen application, used to handle touchscreen automation-related business and interact with the touchscreen page. The test client is a separate program or library that is called by test cases.

[0215] The ultrasound main program sends page data and control data to the touchscreen for processing and display; this data is cached in the ultrasound main program's data processing module. The page data acquisition module and the control data acquisition module interact with the ultrasound main program's data processing module to obtain the currently displayed page type and all buttons displayed on the current page, etc.

[0216] The control path setting module is used to set object names for controls when they are displayed on the page. After setting the object name, the control can be uniquely identified by the name path. This path is used by the control operation module to find the specified control when performing specific tests.

[0217] The control manipulation module is used to obtain the properties of controls along a specified path and perform UI-related tests. This includes obtaining the coordinates and currently displayed data of a specified control, simulating clicks on buttons, and performing page-turning operations on pagination controls. This module employs multiple methods to implement its functions, which are invoked based on the configuration during execution. For example, simulating button clicks can be achieved by writing press and release events to the system device file, or by calling the click methods of specific UI control objects.

[0218] The test client communicates with the test service module to send test case calls and receive test execution results. The test client can run as a standalone program or be embedded as a module within a specific test case.

[0219] Test cases are test cases written by test developers.

[0220] In the touchscreen testing system, perform the following... Figure 8 The processing flow shown is as follows:

[0221] The test client sends test commands to the test server;

[0222] The test server receives the test command, parses the control path, and then searches for the control at the specified path.

[0223] If the specified path control is not found, a failure result is returned;

[0224] If found, retrieve the specified control properties, such as coordinates;

[0225] Based on the configuration, determine how to perform the corresponding operation on the specified control;

[0226] Then, by calling control methods or writing system events, the operation corresponding to the test command is simulated.

[0227] After execution, determine whether the execution was successful and return the result of whether the execution was successful or not.

[0228] When searching for a control at a specified path, the currently displayed page and control information can be obtained through the page data acquisition module and the control data acquisition module, and then compared with the specified path to perform the search.

[0229] When retrieving the properties of a specific control, you can also obtain relevant information about the control through the control data retrieval module, such as display value, current enabled state, coordinate information, etc.

[0230] When performing test operations on a specified control, the selection is based on the current configuration. For example, choosing to write system events will write specified events such as click events to the system to simulate user operations; choosing to call control methods, such as the control's click method or page-turning method, is related to the specific language used to implement the touchscreen page. Flexible configuration is possible as needed.

[0231] This approach also enables test traversal of all operable paths. By using the page data acquisition module and the control data acquisition module, the current page and all buttons on the current page can be obtained, thus enabling full path traversal.

[0232] Corresponding to the above method embodiments, this application also provides an ultrasound diagnostic system. The ultrasound diagnostic system described below and the touch screen testing method described above can be referred to each other.

[0233] See Figure 9 As shown, the ultrasound diagnostic system includes:

[0234] Ultrasound unit 905 and touch screen 902;

[0235] The ultrasound host is equipped with an ultrasound master program 903; the touch screen is embedded with a touch screen program 904;

[0236] The ultrasound main program is used to communicate and interact with the touch screen program;

[0237] The touchscreen program is used to implement the touchscreen testing methods described above.

[0238] Furthermore, the ultrasound diagnostic system may also include a main display that is connected to the ultrasound host.

[0239] Corresponding to the above method embodiments, this application also provides a readable storage medium. The readable storage medium described below can be referred to in conjunction with the touch screen testing method described above.

[0240] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the touchscreen testing method described in the above method embodiments.

[0241] The readable storage medium can specifically be a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or any other readable storage medium capable of storing program code.

[0242] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0243] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0244] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0245] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "include," "contain," or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.

[0246] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A touchscreen testing method, characterized in that, The touchscreen is connected to the ultrasound host, which is configured with an ultrasound main program. The method includes: Obtain the test commands for the touchscreen control, parse the test commands, and obtain the control path; The target control to be tested is determined by searching layer by layer using the control path within the touchscreen page. The operation event that manipulates the target control is sent to the ultrasound main program, and the response result returned by the ultrasound main program for the operation event is received; The test result of the target control is determined based on the response result.

2. The method according to claim 1, characterized in that, Before sending the operation event that manipulates the target control to the ultrasound main program, the program further includes: The target control is simulated to perform the corresponding target operation, and the operation event is obtained.

3. The method according to claim 2, characterized in that, Simulate the execution of the corresponding target operation on the target control, including: The executable program corresponding to the target control is invoked to perform the target operation on the target control; wherein the target operation includes at least one of the following: a click operation and a page turning operation.

4. The method according to claim 1, characterized in that, Sending operation events that manipulate the target control to the ultrasound main program includes: The operation event is written to the system file corresponding to the ultrasound main program.

5. The method according to claim 1, characterized in that, Using the control path to perform a layer-by-layer search to determine the target control to be tested within the touchscreen page includes: Obtain the control object tree of the touch screen; wherein the control object tree contains at least one of the following names: main page name and function page name, and also contains control names; Following the control path, search layer by layer in the control object tree until the control object corresponding to the end point of the control path is found; The found control object is identified as the target control.

6. The method according to claim 5, characterized in that, Before obtaining the control object tree of the touchscreen, the method further includes: When loading and displaying pages and controls, obtain the page name and control name; wherein, the page includes at least one of the main page and function pages; Based on the page name, control name, and the hierarchical relationship between the page and the control, the corresponding object names are set in the tree topology to obtain the control object tree.

7. The method according to claim 1, characterized in that, Determining the test result of the target control based on the response result includes: Analyze the response results to obtain the display attributes corresponding to the target control; If the display attribute matches the operation corresponding to the target control, the test result is determined to be normal.

8. The method according to claim 7, characterized in that, Determining the test result of the target control based on the response result further includes: If the display attribute does not match the operation corresponding to the target control, the test result is determined to be abnormal, and an abnormal prompt message is output based on the state of the target control; wherein, the abnormal prompt message includes at least one of the following: the control does not exist and the control is currently disabled.

9. The method according to any one of claims 1 to 8, characterized in that, Retrieve test commands for touchscreen controls, including: The system iterates through the controls on the touchscreen page. If the current control has not completed testing, the system retrieves the test command corresponding to the current control, continuing until the iteration ends.

10. A touchscreen testing device, characterized in that, The touchscreen is connected to the ultrasound host, which is equipped with an ultrasound main program. The device includes: The command parsing unit is used to obtain test commands for touch screen controls and parse the test commands to obtain the control path; The control determination unit is used to perform a layer-by-layer search using the control path to determine the target control to be tested from within the page of the touch screen. An operation response unit is used to send an operation event that operates on the target control to the ultrasound main program, and to receive the response result returned by the ultrasound main program in response to the operation event; The result determination unit is used to determine the test result of the target control based on the response result.

11. A touchscreen testing system, characterized in that, include: The touch screen and the ultrasound host are provided, wherein the ultrasound host is equipped with an ultrasound main program and the touch screen is embedded with a test server. The test server is used to implement the touch screen test method as described in any one of claims 1 to 9.

12. The touchscreen testing system according to claim 11, characterized in that, The testing system also includes a testing client, and the testing server includes a testing service module and a control operation module; the testing service module communicates with the testing client via network. The test service module is used to receive test requests sent by the test client, parse the test requests, obtain test commands, send the test commands to the control operation module, and when it detects an operation event of the control operation module operating the target control to be tested, send the operation event to the ultrasound main program, receive the response result returned by the ultrasound main program for the operation event, determine the test result of the target control based on the response result, and send the test result to the test client. The control operation module is used to parse the test command, obtain the control path, and use the control path to perform a layer-by-layer search to determine the target control to be tested from within the touch screen page; and generate operation events to operate on the target control.

13. The touchscreen testing system according to claim 11, characterized in that, The test server also includes: a page and control data acquisition module and a control path setting module; the page and control data acquisition module interacts with the ultrasound main program; The page and control data acquisition module is used to acquire the page type and control information of the current page from the ultrasound main program. The control path setting module is used to obtain the page type and control information from the page and control data acquisition module, and generate the page name and control name; wherein, the page name and control name are used to generate the control path.

14. An ultrasound diagnostic system, characterized in that, include: An ultrasound host and a touch screen; the ultrasound host is equipped with an ultrasound main program; the touch screen is embedded with a touch screen program; The ultrasound main program is used to communicate and interact with the touch screen program. The touchscreen program is used to implement the touchscreen testing method as described in any one of claims 1 to 9.

15. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the touchscreen testing method as described in any one of claims 1 to 9.