Complex graphical interface black box test automation method and system

By designing a black box test automation method and system for complex graphical interfaces, using preloaded control relationship data structures and control state recognition and operation methods, the problem that the existing technology cannot effectively deal with complex graphical interfaces is solved, and efficient and accurate automated testing is achieved.

CN120066978AActive Publication Date: 2025-05-30SIGNAL & COMM RES INST OF CHINA ACAD OF RAILWAY SCI +3

Patent Information

Application Number
CN202510552500.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-05-30
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

The automated testing technology of existing railway scheduling centralized systems cannot effectively handle complex graphical interfaces, especially when the interface control pops up the drop-down box and updates the list, the identification and verification process is complicated and cannot respond in a timely manner.

Method used

A black box test automation method and system for complex graphical interfaces is designed. Through preloading control relationship data structures and control state recognition and operation methods, a black box test automation method and system suitable for complex graphical interfaces of CTC systems is formed. The system includes a positioning module, an execution module and a verification module. Through a tree diagram, it can quickly and accurately locate and simplify the control recognition process.

Benefits of technology

It improves the real-time and accuracy of automated testing, can effectively handle complex graphical interfaces, supports black box automation testing function, and enables railway scheduling centralized systems to have the ability to test complex interface graphics layout.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066978A_ABST
    Figure CN120066978A_ABST
Patent Text Reader

Abstract

The invention discloses a complex graphical interface black box test automation method, which is used for a railway dispatching centralized system, and comprises the following steps: S1, calling a positioning module to accurately identify a control position of a control in a software interface to form positioning data; s2, reading test data stored outside, calling an execution module to simulate an input device to operate a control according to the data type of the test data, and / or calling a verification module to check the state of a software interface control; wherein the test data comprises the positioning data. The invention also discloses a corresponding system which comprises a positioning module (101), an execution module (102) and a verification module (103). The invention further discloses corresponding electronic equipment and a computer readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automated black-box testing of railway centralized traffic control systems, and particularly relates to a method and system for automating black-box testing of complex graphical interfaces. Background Art

[0002] Currently, the automated black-box testing technology applied to railway computer applications mainly relies on a non-intrusive UI control interaction and system behavior verification system. The automated black-box testing technology uses the underlying functions of the operating system where the target program is located, a test framework, or a third-party test driver interface to achieve non-intrusive UI control interaction. Its core mechanisms include window handle control tree topology parsing and low-level input event injection. During the testing process, mouse and keyboard operation simulation can be subdivided into global event triggering based on absolute coordinate positioning and local event triggering based on the relative coordinates of controls. On the basis of simulating mouse and keyboard operations, the automated black-box testing technology constructs a system behavior verification system through state recognition based on image template matching, regular expression matching, intercepting the application program message flow, and an exception capture mechanism, thereby completing the closed-loop of the automated black-box testing process. A common method for state recognition can be an enhanced dynamic interface element recognition method that combines an image recognition engine and optical character recognition technology.

[0003] The core architecture of the current automated testing technology for railway centralized traffic control systems (Centralized Traffic Control, abbreviated as CTC) consists of an automated test execution engine, a proxy program, the CTC subsystem under test, and an external simulation system, and realizes function decoupling through the core architecture as shown in Figure 1 The automated test execution engine completes the execution operations for different test requirements and test logics, gives test results, realizes result analysis and report customization, compares and analyzes the test results, and completes the customization, output, and printing of corresponding reports according to user requirements. The test proxy completes operations such as image capture, operating the external system simulation, and setting test conditions. The external system simulation receives the control operations from the proxy program and returns the representation information to the automated test execution engine.

[0004] In the test preparation stage, the existing automated testing technology uses a dynamic condition exploration algorithm to construct and establish an object relationship topology model and automatically generate test scenarios, and then dynamically stores test data through a database design method with a relational multi-table structure, records hash checksums, data integrity protection, and full-process data traceability of the test.

[0005] During the testing process, the execution engine transmits test instructions to the agent program through a dual-channel protocol, and then uses a triple composite technology of logical operation, data comparison, and image recognition to synchronously process the picture information parsing task and the CTC system status verification task, and controls the test cycle of a single test through the agent program parallel control technology and the environment reset function. The testing process adopts a closed-loop feedback mechanism, dynamically adjusts the CTC subsystem configuration data according to the picture recognition result, and realizes the test scenario coverage and adaptive verification of the CTC subsystem under test.

[0006] The current picture information parsing method used in the automated testing technology of the railway dispatching centralized system (CTC) is a triple composite technology of logical operation, data comparison, and image recognition. The control recognition process is complex and cannot respond in a timely manner to complex situations such as the drop-down box popping up in the interface control and the drawing overlapping in the interface when the list is updated.

[0007] In addition, the current picture information parsing method is only applicable to subsystems with simple interface graphic layouts and is not applicable to subsystems with complex interface graphic layouts. The test execution engine and agent program of the existing automated testing technology focus on the automation of data testing. The supporting object relationship topology model is not applicable to parsing complex interface graphic layouts, and there is a lack of automated support for graphic interface human-computer interaction testing at the architecture level. Summary of the Invention

[0008] The purpose of the present invention is to provide a black-box testing automation method and system for complex graphical interfaces, which is used for the black-box testing of the complex graphical interfaces of the railway dispatching centralized system. Due to the lack of automated support for graphical interface human-computer interaction testing at the architecture level in the prior art, the present invention designs a pre-loadable control relationship data structure and supporting control state recognition and operation methods to form a black-box testing automation method and system suitable for the complex graphical interfaces of the CTC system, making up for the deficiencies of the prior art.

[0009] The first aspect of the present invention lies in providing a black-box testing automation method for complex graphical interfaces, which is used for the railway dispatching centralized system, including: S1, calling the positioning module to accurately identify the control position of the control in the software interface to form positioning data; S2, reading the test data stored externally, and according to the data type of the test data, calling the execution module to simulate an input device to operate the control, and / or calling the verification module to check the control state of the software interface; wherein the test data includes the positioning data.

[0010] Preferably, the S2 includes: S21, reading the test data stored externally; wherein the test data consists of positioning data, execution data, verification data, and verification records; wherein the positioning data is provided by the positioning module; S22, simulating the actions of the personnel in the train operation dispatching position to change the system interface or the state of the control through mouse and / or keyboard operations based on the combined structure of the positioning module and the execution module; and S23, simulating the actions of the human eye to confirm and check whether the state of the control conforms to the normal process of train operation dispatching based on the verification module; wherein, the verification module forms buffered content by caching the state or content of the control to perform the logical judgment of whether it conforms to the normal process of train operation dispatching.

[0011] Preferably, the behavioral characteristics of the software process under test are determined by the local file configuration. After the local file configuration is changed, the software process under test loads the changed items of the local file configuration by restarting.

[0012] Preferably, the accurate identification of the control position in the software interface by the positioning module in S1 includes: S11, calling the positioning module to construct a tree diagram of the computer display interface and preloading the tree diagram of the computer display interface; S12, storing the tree diagram of the computer display interface in the memory as the positions of all controls in the interface; Wherein, S11 includes: (1) Identifying the relationships between all controls in the computer display interface based on the positioning module to form a first relationship tree; wherein the relationships between all controls in the computer display interface are respectively identified as parent-child relationships or sibling relationships; (2) Identifying the relationships between all windows, panels, lists, and / or buttons in the computer display interface based on the positioning module to form a second relationship tree; (3) Constructing a tree diagram of the computer display interface based on the first relationship tree and the second relationship tree, where the controls with a parent-child relationship are located at different levels in the tree diagram, and the controls with a sibling relationship are located at the same level in the tree diagram.

[0013] Preferably, S22, simulating the actions of the personnel in the train operation dispatching position to change the system interface or the state of the control through mouse and / or keyboard operations based on the combined structure of the positioning module and the execution module; includes: (1) Connecting to the software process under test, (2) Based on the execution module, calling the cached content of the verification module, and performing specific operations according to the execution data and the objects to be operated in the test data; As a preferred implementation, the specific operations include: simulating one or more operations among mouse clicks, mouse drags, mouse scroll wheels, mouse hovers, keyboard inputs, and keyboard controls performed by the user in the software interface.

[0014] Preferably, the execution of specific operations on the basis of the execution data and the object to be operated in the test data includes: A. If the object to be operated is a control recognized by the positioning module, the execution module performs one or more operations among moving the mouse above the control, clicking the left mouse button on the control, clicking the right mouse button on the control, inserting text at the cursor position of the text box, pressing the button control, setting the window to maximize or minimize, selecting a list item or a drop-down list item, and selecting or deselecting a checkbox; B. If the object to be operated is the process of the software under test, the execution module performs one or more operations among modifying the local file configuration and restarting the process of the software under test. Meanwhile, the execution module calls the cached content of the verification module, searches for sub-controls according to the cached content, and performs a selection operation.

[0015] Preferably, in step S23, based on the verification module, an action of simulating the confirmation of a human eye and checking whether the control state conforms to the normal process of train operation dispatching is performed; wherein, the verification module forms buffered content by caching the control state or control content to perform a logical judgment on whether the action conforms to the normal process of train operation dispatching, including: (1) Based on the verification module, verifying the change in the control state caused by the operation of the execution module, including: The button becomes in a pressed state after being clicked, the text box displays the input text and blinks the cursor when being edited, the checkbox displays a tick mark when being selected, the drop-down list expands to display options when being clicked, the list collapses after being selected, the selected item in the list box is highlighted, and the position of the slider changes suddenly after being operated; (2) Based on the verification module, checking whether the change in the control state conforms to the design expectation of the test case according to the verification data in the test data, including: The number of verification data is single or multiple, corresponding to a single or multiple controls to be verified. Each piece of verification data corresponds to one state check, and the check content comes from the given constant in the verification data or other controls specified by the positioning data or the previous test steps; After all state checks pass, the verification module determines that the current state check verification passes. If there is one failure, it is considered that the current state check verification fails; If the state change conforms to the design expectation of the test case, the verification module extracts the text expression of verification passing from the verification record in the test data and records it in the test result. Otherwise, the module extracts the text expression of verification failure and records it in the test result; wherein, the verification module extracts the control state or control content for caching to form the cached content of the verification module, which is used in step S22. The cached content can be called by the execution module to perform the operation of searching for sub-controls according to the cached content and performing a selection operation.

[0016] The second aspect of the present invention is to provide a black box testing automation system for complex graphical interfaces for a railway dispatching centralized system, which is used to implement the method of the first aspect, including: A positioning module (101) for accurately identifying the control position of a control in a software interface after being called to form positioning data; An execution module (102) for reading test data stored externally and simulating the operation of an input device on a control according to the data type of the test data; wherein the test data includes the positioning data; and A verification module (103) for checking the control state of a software interface after being called.

[0017] The third aspect of the present invention provides an electronic device, including a processor and a memory, the memory stores multiple instructions, and the processor is used to read the instructions and execute the method described in the first aspect.

[0018] The fourth aspect of the present invention provides a computer-readable storage medium, the computer-readable storage medium stores multiple instructions, and the multiple instructions can be read and executed by a processor to execute the method described in the first aspect.

[0019] Advantages of the method and system of the present invention:

[0020] 1. The controls in the computer display interface are constructed and stored as a tree diagram, and all control positions in the interface are stored in memory through preloading, which is faster and more accurate in positioning controls compared with the existing method of parsing picture information. Organizing the controls in a complex graphical interface into a tree diagram form and performing preloading simplifies the control recognition process and improves the real-time performance and accuracy of the automated testing method.

[0021] 2. A black box testing automation system architecture for complex graphical interfaces including a positioning module, an execution module, and a verification module, as well as test data including a test case table, a test template table, and a test unit table. Compared with the system architecture of the existing method, the system architecture of the present invention has the black box automation testing function for the complex graphical interface subsystem.

[0022] 3. The construction methods of the positioning module, the execution module, and the verification module in the black box testing automation system architecture for complex graphical interfaces, as well as the construction methods of the test case table, the test template table, and the test unit table of the black box test cases for the railway dispatching centralized system, construct a black box testing automation method and system applicable to the complex interface graphical layout, enabling the railway dispatching centralized system to have the black box automation testing function for the complex graphical interface subsystem. Description of the Drawings

[0023] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the related art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0024] Figure 1 It is a flowchart of the complex graphical interface black box testing automation method provided according to an embodiment of the present invention; Figure 2 It is a schematic diagram of the principle architecture of the complex graphical interface black box testing automation method provided according to an embodiment of the present invention; Figure 3 It is a schematic diagram of the data composition of the test steps provided according to an embodiment of the present invention; Figure 4 It is a schematic diagram of the tree diagram relationship structure of the controls provided according to an embodiment of the present invention; Figure 5 It is a schematic diagram of the principle of constructing multiple test steps into a test unit provided according to an embodiment of the present invention; Figure 6 It is a flowchart of the construction method of test cases, test templates, and test units provided according to an embodiment of the present invention; Figure 7 It is a schematic diagram of the architecture of the complex graphical interface black box testing automation system provided according to an embodiment of the present invention; Figure 8 It is a structural diagram of an electronic device provided according to an embodiment of the present invention. Specific Embodiments

[0025] The following will clearly and completely describe the technical solutions of the present invention in conjunction with the drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0026] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. In addition, the terms "first", "second", "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.

[0027] In the description of the present invention, it should be noted that, unless otherwise clearly defined and limited, the terms "installation", "connection", and "coupling" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be a direct connection or an indirect connection through an intermediate medium, and it may be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations. Embodiment 1

[0028] Figure 1 As shown, this embodiment provides an automated method for black box testing of a complex graphical interface for a railway dispatching centralized system, including: S1. Call the positioning module to accurately identify the control position of the control in the software interface to form positioning data; S2. Read the test data stored externally, and according to the data type of the test data, call the execution module to simulate the input device (mouse or keyboard) to operate the control, and / or call the verification module to check the status of the software interface control; wherein the test data includes the positioning data.

[0029] As a preferred implementation manner, S2 includes: S21. Read the test data stored externally; S22. Based on the combined structure of the positioning module and the execution module, simulate the actions of the train dispatching position personnel to change the system interface or control status through mouse and / or keyboard operations; and S23. Based on the verification module, simulate the actions of the human eye to confirm and check whether the control status conforms to the normal process of the train dispatching business; wherein, the verification module forms buffer content by caching the control status or control content to perform the logical judgment of whether it conforms to the normal process of the train dispatching business.

[0030] As a preferred implementation manner, the test data of S21 is composed of positioning data, execution data, verification data, and verification records; wherein the positioning data is provided by the positioning module.

[0031] In this embodiment, the test data is in the form of parameters for each test step, that is, each test step is expressed as test data. Among them, a single test step is composed of a data group formed by one execution data and multiple verification data. The positioning data before each data group corresponds to the control position in the software interface. By loading the execution data and the verification data, the black box test automation method can automatically complete all test steps of the required behavior characteristics of the software under test process. If, among the behavior characteristics of the software under test process, a certain verification content is a verification failure, the black box test automation method loads the record of the verification failure into the external test result to form the verification record. If the verification content is a verification pass, the record of the verification pass is loaded.

[0032] As a preferred embodiment, Figure 2 the behavior characteristics of the software under test process are determined by the local file configuration. When the local file configuration changes, the software under test process loads the changed items of the local file configuration by restarting.

[0033] As a preferred embodiment, the accurate identification of the control position of the control in the software interface by the call positioning module in S1 includes: S11, the call positioning module constructs a tree diagram of the computer display interface and performs preloading of the tree diagram of the computer display interface; S12, stores the tree diagram of the computer display interface in the memory as all control positions in the interface.

[0034] As a preferred embodiment, S11 includes: (1) Based on the positioning module, identify the relationships between all controls in the computer display interface to form a first relationship tree; among them, the relationships between all controls in the computer display interface are respectively identified as parent-child relationships or sibling relationships. If control A contains controls B and C in the software interface, then the relationships between A and B, and A and C are identified as parent-child relationships by the positioning module, and the relationship between B and C is identified as a sibling relationship by the positioning module.

[0035] (2) Based on the positioning module, identify the relationships between all windows, panels, lists, and / or buttons in the computer display interface to form a second relationship tree; (3) Based on the first relationship tree and the second relationship tree, construct a tree diagram of the computer display interface, as Figure 4 shown. Controls with a parent-child relationship are located at different levels in the tree diagram, and controls with a sibling relationship are located at the same level in the tree diagram.

[0036] In this embodiment, in Figure 4In the shown tree diagram, the location of a control can be described as the path from the root node through each hierarchical window node and panel node in sequence until reaching the corresponding node of the specified control, that is, represented by the progressive connection relationship between the parent node and the child node. Each positioning data in the test steps uses the expression "root>child node 1>child node 2>target node" to locate the specific control. For example, Figure 4 the positioning data of button 1 in Figure 4 is desktop>window 3>panel 2>button 1, that is, the progressive process from the desktop root node through window 3 and panel 2 and finally reaching the leaf node button 1. When the positioning module identifies a control, the black box testing automation method extracts the positioning data from the test data and then identifies the specific control one by one according to the given information.

[0037] As a preferred embodiment, in S22, based on the combined structure of the positioning module and the execution module, simulate the actions of the personnel in the train operation dispatching position to change the system interface or the control state through mouse and / or keyboard operations; including: (1) Connect to the software process under test, (2) Based on Figure 2 in the execution module, call the cached content of the verification module, and perform specific operations according to the execution data and the object to be operated in the test data; As a preferred embodiment, the specific operations include: simulating one or more operations among mouse click, mouse drag, mouse wheel, mouse hover, keyboard input, and keyboard control performed by the user in the software interface.

[0038] As a preferred embodiment, performing specific operations according to the execution data and the object to be operated in the test data includes: A. If the object to be operated is a control identified by the positioning module, the execution module performs one or more operations among moving the mouse above the control, left-clicking the control, right-clicking the control, inserting text at the cursor of the text box, pressing the button control, setting the window to maximize or minimize, selecting a list item or a drop-down list item, and selecting or deselecting a checkbox; B. If the object to be operated is the software process under test, the execution module performs one or more operations among modifying the local file configuration and restarting the software process under test. At the same time, the execution module calls the cached content of the verification module and searches for sub-controls according to the cached content and performs a selection operation.

[0039] As a preferred embodiment, in S23, based on the verification module, simulate the actions of the human eye to confirm and check whether the control state conforms to the normal process of the train operation dispatching service; among them, the verification module forms buffered content by caching the control state or the control content to perform a logical judgment on whether it conforms to the normal process of the train operation dispatching service, including: (1) Based on Figure 2The verification module in verifies the control state changes caused by the operations of the execution module, including:

[0040] (2) Based on Figure 2 the verification module in checks whether the changes in the control state conform to the design expectations of the test cases according to the verification data in the test data, including: The number of verification data is single or multiple, corresponding to single or multiple controls to be verified. Each piece of verification data corresponds to one state check, and the check content comes from the given constants in the verification data or other controls specified by the positioning data or the previous test steps; After all state checks pass, the verification module determines that the current state check passes. If there is one failure, it is considered that the current state check fails;

[0041] Figure 2 The system architecture of Figure 5 can process the positioning data, execution data, and verification data within a single test step, or can also process the test data of multiple test steps. The black-box test automation method combines the test steps of the software process under test into test units in the Figure 5 shown manner.

[0042] As a preferred implementation, the black-box test automation method manages multiple test cases, multiple test templates, and multiple test units; the multiple test cases, the multiple test templates, and the multiple test units are numbered and constructed in the Figure 6 shown manner, where the combination of multiple test units constitutes a test template, and the combination of multiple test templates constitutes a test case. Figure 6In it, different test templates can reuse the same test unit, and different test cases can reuse the same test template, enabling the black-box testing automation method to flexibly construct test cases by adjusting the combination method to meet different black-box testing requirements. After the black-box testing automation method executes all the test units in a single test case, the generated test result record is the automated test result of that test case. Embodiment 2

[0043] As Figure 7 shown, this embodiment provides a black-box testing automation system for a complex graphical interface, which is used for the railway dispatching centralized system and is used to implement the method of Embodiment 1, including: A positioning module 101, which is used to accurately identify the control position of a control in the software interface after being called to form positioning data; An execution module 102, which is used to read the test data stored externally and, according to the data type of the test data, simulate the operation of an input device (mouse or keyboard) on the control after being called; wherein the test data includes the positioning data; and A verification module 103, which is used to check the control state of the software interface after being called.

[0044] The present invention also provides a memory storing multiple instructions for implementing the method as in Embodiment 1.

[0045] As Figure 8 shown, the present invention also provides an electronic device, including a processor 301 and a memory 302 connected to the processor 301. The memory 302 stores multiple instructions that can be loaded and executed by the processor so that the processor can execute the method as in Embodiment 1. Application Embodiment

[0046] Taking the execution process of a single test case of a subsystem of the railway dispatching centralized system as an example, the implementation details of the black-box testing automation method and system are demonstrated. The software process under test is the dispatching command subsystem of the railway dispatching centralized system, and the relevant tabular data of the test case is shown in Tables 1, 2, 3, and 4. Tables 1 and 2 are the test case table and the test template table respectively, and Tables 3 and 4 are the unit data part and the module application data part of the test unit table respectively. The positioning data, execution data, and verification data in Table 4 are expressed in text according to the functions implemented by the data.

[0047] Table 1 Test Case Table

[0048] Use Case Number Use Case Description Template Sequence 1 Verify the conversion function of the command query interface in scenario 1 of the cache box panel 1,14,15;

[0049] Table 2 Test Template Table

[0050] Template Number Template Description Unit Sequence 1 Create a new dispatching command that includes the station and the locomotive receiving point 1,2; 14 After configuring QueryCmdCopy=1 in Order.ini, restart the process of the software under test 17,6; 15 Convert the first entry of the current cache box panel in the query command window 19,23,18;

[0051] Table 3 Test Unit Table (Unit Data Part)

[0052]

[0053] Table 4 Test Unit Table (Module Application Data Part)

[0054] The black-box testing automation method first constructs and stores a tree diagram of the computer display interface and preloads it. Then, Test Case 1 in Table 1 is refined into Test Template 1, Test Template 14, and Test Template 15. Test Template 1 sequentially includes Test Units 1 and 2, Test Template 2 sequentially includes Test Units 17 and 6, and Test Template 15 sequentially includes Test Units 19, 23, and 18. During the processing, the black-box testing automation method generates test results and stores them in the test result table.

[0055] For Step 1 of processing Test Unit 1 by the black-box testing automation method, the positioning module locates the refresh button from the root node according to the tree diagram, and the execution module performs the press operation. After performing the press operation, the verification module checks whether the state of the new button on the same panel is available and whether the state of the refresh button is grayed out. If the verification result is that the new button is available and the refresh button is grayed out, the verification module records the corresponding expression of passing the verification in the test results.

[0056] For Step 2 of processing Test Unit 1 by the black-box testing automation method, the positioning module locates the new button from the root node according to the tree diagram, and the execution module performs the press operation.

[0057] For Step 3 of processing Test Unit 1 by the black-box testing automation method, the positioning module locates the entry of the dispatching command subsystem dropdown box with type 5 from the root node according to the tree diagram, and the execution module performs the selection operation.

[0058] For Step 4 of processing Test Unit 1 by the black-box testing automation method, the positioning module locates the entry of the dispatching command subsystem dropdown box with subtype 12 from the root node according to the tree diagram, and the execution module performs the selection operation.

[0059] For Step 5 of processing Test Unit 1 by the black-box testing automation method, the positioning module locates the cache button from the root node according to the tree diagram, and the execution module performs the press operation.

[0060] For Step 1 of processing Test Unit 2 by the black-box testing automation method, the positioning module locates the entry where Station 1 of the receiving order point list is located from the root node according to the tree diagram, and the execution module performs the tick operation.

[0061] For step 2 of the black box testing automation method for processing test unit 2, the positioning module locates from the root node to the entry where the list of receiving points, station 2, is located according to the tree diagram, and the execution module performs the ticking operation.

[0062] For step 3 of the black box testing automation method for processing test unit 2, the positioning module locates from the root node to the cache button according to the tree diagram, and the execution module performs the pressing operation. After performing the pressing operation, the positioning module locates from the root node to the command number control, then to the entry where the first item in the cache box panel list is located, and the verification module checks whether the control content of the command number control is consistent with that of the first item in the cache box panel list. The positioning module locates from the root node to the entry where the first item in the cache box panel list is located, and the verification module checks whether the first item in the cache box panel list is visible. The positioning module locates from the root node to the receiving order place control, and the verification module checks whether the control content of the receiving order place control is empty. If the verification results show that the command numbers of the cache box panel and the main panel are consistent, the first command in the cache box panel is visible, and the receiving order place text is not empty, the verification module records the corresponding expression of passing the verification into the test results.

[0063] For step 1 of the black box testing automation method for processing test unit 17, the black box testing automation method operates on configuration file 1 in the main program directory, and the execution module performs the operation of modifying the local file configuration.

[0064] For step 2 of the black box testing automation method for processing test unit 17, the black box testing automation method operates on the software under test process in the main program directory, and the execution module performs the operation of restarting the software under test process.

[0065] For step 1 of the black box testing automation method for processing test unit 6, the positioning module locates from the root node to the user name control on the login interface according to the tree diagram, and the execution module performs the operation of inserting the user name string text.

[0066] For step 2 of the black box testing automation method for processing test unit 6, the positioning module locates from the root node to the password control on the login interface according to the tree diagram, and the execution module performs the operation of inserting the password string text.

[0067] For step 3 of the black box testing automation method for processing test unit 6, the positioning module locates from the root node to the login button on the login interface according to the tree diagram, and the execution module performs the operation of pressing the login button.

[0068] For step 4 of the black box testing automation method for processing test unit 6, the positioning module locates from the root node to the main interface of the dispatching command subsystem according to the tree diagram, and the execution module performs the operation of maximizing the window of the dispatching command subsystem.

[0069] The black-box testing automation method processes Test Unit 19, Step 1. The positioning module locates the query command tab from the root node according to the tree diagram, and the execution module performs the operation of moving the mouse over the control. After performing the operation of moving the mouse over the control, the positioning module locates the entry where the first item in the cache box panel list is located from the root node, and the verification module extracts the content of the entry where the first item in the cache box panel is located for caching. The verification result is that by extracting the command number of the first command in the cache box panel, the verification module records the corresponding expression of passing the verification into the test result.

[0070] The black-box testing automation method processes Test Unit 23, Step 1. The positioning module locates the query issued command checkbox from the root node according to the tree diagram, and the execution module performs the operation of selecting the checkbox.

[0071] The black-box testing automation method processes Test Unit 18, Step 1. The positioning module locates the query button from the root node according to the tree diagram, and the execution module performs the operation of pressing the query button.

[0072] The black-box testing automation method processes Test Unit 18, Step 2. The positioning module locates the query list from the root node according to the tree diagram, and the execution module calls the cached content of the verification module, and finds the corresponding entry in the query list according to the cached content and performs the selection operation.

[0073] The black-box testing automation method processes Test Unit 18, Step 3. The positioning module locates the conversion button from the root node according to the tree diagram, and the execution module performs the operation of pressing the conversion button. After performing the operation of pressing the conversion button, the positioning module locates the cache box panel list from the root node, and the verification module extracts the number of entries in the cache box panel list for caching. The verification result is that by extracting the number of entries in the cache box panel list, the verification module records the corresponding expression of passing the verification into the test result.

[0074] The black-box testing automation method processes Test Unit 18, Step 4. The positioning module locates the query command tab from the root node according to the tree diagram, and the execution module moves the mouse over the control. After performing the operation of moving the mouse over the control, the positioning module locates the cache box panel list from the root node, and the verification module extracts the number of entries in the cache box panel list and compares it with the cached content to verify whether the number of entries has increased by 1 compared to the cached number. The verification result is that the number of entries is inconsistent with the cached number, the scheduling command conversion fails, and the verification module records the corresponding expression of failing the verification into the test result. The black-box testing automation method has been executed, and the test results are shown in Table 5.

[0075] Table 5 Test Result Table

[0076] Result Number Unit Number Step Number Test Result Test Record 1 1 1 Passed The new button is available, passed; the refresh button is automatically grayed out, passed; 2 2 3 Passed The command numbers in the cache box panel are the same as those in the main panel, passed; the first command in the cache box panel is visible, passed; the receiving location text is not empty, passed; 3 19 1 Passed Extract the command number of the first entry in the cache box panel, passed; 4 18 3 Passed Extract the number of entries in the cache box panel list, passed; 5 18 4 Failed The conversion of the dispatching command failed;

[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than 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 or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A complex graphical interface black box test automation method for railway dispatching centralized system, characterized in that: include: S1, calling the positioning module to accurately identify the control position of the control in the software interface to form positioning data; S2, reading test data stored externally, and according to the data type of the test data, calling the execution module to simulate the input device to operate the control, and / or calling the verification module to check the status of the software interface control; wherein the test data includes the positioning data.

2. The complex graphical interface black box test automation method according to claim 1, characterized in that: The S2 includes: S21, reading test data stored externally; wherein the test data consists of positioning data, execution data, verification data and verification records; wherein the positioning data is provided by the positioning module; S22, simulating the action of the vehicle dispatching personnel changing the system interface or control state by mouse and / or keyboard operation based on the combined structure of the positioning module and the execution module; and S23, based on the verification module simulating human eyes to confirm and check whether the control state conforms to the normal process of vehicle dispatching business; wherein, the verification module forms a buffer content by caching the control state or the control content to make a logical judgment on whether the action conforms to the normal process of vehicle dispatching business.

3. The complex graphical interface black box test automation method according to claim 2, characterized in that: The behavior characteristics of the software process under test are determined by the local file configuration. When the local file configuration is changed, the software process under test loads the changed items of the local file configuration by restarting.

4. The complex graphical interface black box test automation method according to claim 3 is characterized in that: The calling of the positioning module in S1 to accurately identify the control position of the control in the software interface includes: S11, calling the positioning module to construct a tree diagram of the computer display interface and preload the tree diagram of the computer display interface; S12, storing the tree diagram of the computer display interface in a memory as the positions of all controls in the interface; Wherein, the S11 includes: (1) Based on the positioning module, the relationship between all controls in the computer display interface is identified to form a first relationship tree; wherein the relationship between all controls in the computer display interface is identified as a parent-child relationship or a brother relationship; (2) identifying the relationship between all windows, panels, lists and / or buttons in the computer display interface based on the positioning module to form a second relationship tree; (3) A tree diagram of a computer display interface is constructed based on the first relationship tree and the second relationship tree, wherein controls in a parent-child relationship are located at different levels in the tree diagram, and controls in a sibling relationship are located at the same level in the tree diagram.

5. The complex graphical interface black box test automation method according to claim 4, characterized in that: The S22, based on the combined structure of the positioning module and the execution module, simulates the action of the vehicle dispatching personnel changing the system interface or the control state through mouse and / or keyboard operation; includes: (1) Connect to the software process under test, (2) Based on the execution module, the cache content of the verification module is called, and a specific operation is performed according to the execution data and the operated object in the test data; The specific operation includes: simulating one or more operations of mouse clicking, mouse dragging, mouse wheel rolling, mouse hovering, keyboard input and keyboard control performed by a user in a software interface.

6. The complex graphical interface black box test automation method according to claim 5, characterized in that: The performing of a specific operation according to the execution data and the operated object in the test data comprises: A. If the operated object is a control identified by the positioning module, the execution module executes one or more operations of moving the mouse to the top of the control, left-clicking the control, right-clicking the control, inserting text at the text box cursor, pressing the button control, maximizing and minimizing the window, selecting a list item or a drop-down list item, and selecting or deselecting a check box; B. If the operated object is the software process under test, the execution module executes one or more operations of modifying the local file configuration and restarting the software process under test. At the same time, the execution module calls the cache content of the verification module, searches for the sub-control according to the cache content and executes the selected operation.

7. The complex graphical interface black box test automation method according to claim 6, characterized in that: The S23, based on the verification module simulating human eyes to confirm and check whether the control state conforms to the normal process of the vehicle dispatching business; wherein the verification module forms a buffer content by caching the control state or the control content to make a logical judgment on whether the action conforms to the normal process of the vehicle dispatching business includes: (1) Based on the verification module, the control state changes caused by the execution module operation are verified, including: A button changes to a pressed state when clicked, a text box displays the entered text and blinks the cursor when being edited, a check box displays a check mark when selected, a drop-down list expands to display options when clicked and collapses when selected, a list box highlights the selected item, and a slider changes position when operated; (2) Based on the verification module, check whether the change of the control state meets the design expectations of the test case according to the verification data in the test data, including: The number of verification data is single or multiple, corresponding to single or multiple verified controls. Each verification data corresponds to a status check, and the check content comes from the given constants in the verification data or from other controls or previous test steps specified by the positioning data; After all status checks are passed, the verification module determines that the current status check verification has passed. If one status check fails, the current status check verification is considered to have failed. If the state change meets the design expectations of the test case, the verification module extracts the text description of the passed verification from the verification record in the test data and records it in the test result. Otherwise, the module extracts the text description of the failed verification and records it in the test result. The verification module extracts the control state or control content for caching to form the cache content of the verification module, which is used in S22. The cache content can be called by the execution module to perform the operation of searching for sub-controls according to the cache content and performing the selection operation.

8. A complex graphical interface black box test automation system, used in a railway dispatching centralized system, used to implement any of the methods described in claims 1-7, characterized in that: include: A positioning module (101), used to accurately identify the position of a control in a software interface and form positioning data after being called; An execution module (102) is used to read test data stored externally and, according to the data type of the test data, invoke and simulate the operation of the input device on the control; wherein the test data includes the positioning data; and The verification module (103) is used to check the status of the software interface controls after calling.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the processor is used to read the instructions and execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the plurality of instructions can be read by a processor to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Automatic black box testing method based on graphical user interface

    CN113704125A

  • Interface interaction test method, device, equipment and storage medium

    CN113836037A

  • Automatic testing method and system based on control attributes and image recognition, electronic equipment and storage medium

    CN115114152A

  • Interface testing method and device

    CN118093428A

  • Intelligent automation of UI interactions

    US20230214239A1

Cited By

  • CTC graph data updating and checking method and system based on tree diagram mapping mechanism

    CN121188240A