A black box testing automation method and system for complex graphical interfaces

By constructing a control relationship data structure and simulating human-computer interaction operations, the problem of automated testing of complex interfaces in the railway dispatching centralized system was solved, the accurate positioning and status inspection of complex interfaces were achieved, and the real-time performance and accuracy of the test were improved.

CN120066978BActive Publication Date: 2025-10-03SIGNAL & COMM RES INST OF CHINA ACAD OF RAILWAY SCI +3
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing automated testing technology for railway dispatching centralized systems cannot effectively analyze complex interface graphic layouts, especially when drop-down boxes pop up in interface controls or drawings overlap when updating lists. It is unable to respond in a timely manner and lacks automated support for human-computer interaction in graphical interfaces.

Method used

An automated black-box testing method for complex graphical interfaces was designed. By constructing a control relationship data structure and a control state recognition method, the control positions were preloaded and human-computer interaction operations were simulated. The method included a positioning module, an execution module, and a verification module to achieve accurate positioning and state checking of complex interfaces.

Benefits of technology

It improves the real-time performance and accuracy of automated testing, can quickly identify and operate controls in complex graphical interfaces, and realizes the black box automated testing function of the railway dispatching centralized system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066978B_ABST
    Figure CN120066978B_ABST
Patent Text Reader

Abstract

The present invention discloses a black box test automation method for a complex graphical interface, which is used in a railway dispatching centralized system. The method comprises: S1, calling a positioning module to accurately identify the control position of a control in a software interface to form positioning data; S2, reading test data stored externally and, based on the data type of the test data, calling an execution module to simulate an input device to operate the control, and / or calling a verification module to check the status of the software interface control; wherein the test data includes the positioning data. A corresponding system is also disclosed, comprising a positioning module (101), an execution module (102), and a verification module (103). A corresponding electronic device and a computer-readable storage medium are also disclosed.
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 a railway dispatching centralized system, and in particular to an automated method and system for black box testing of a complex graphical interface. Background Art

[0002] Currently, automated black-box testing technology used in railway computer applications primarily relies on a non-intrusive UI control interaction and system behavior verification system. Automated black-box testing technology uses the underlying functions of the target program's operating system, testing frameworks, or third-party test-driven interfaces to achieve non-intrusive UI control interaction. Its core mechanisms include window handle control tree topology parsing and low-level input event injection. During testing, mouse and keyboard operation simulation can be subdivided into global event triggering based on absolute coordinate positioning and local event triggering based on control relative coordinates. Based on simulated mouse and keyboard operations, automated black-box testing technology constructs a system behavior verification system through state recognition based on image template matching, regular expression matching, interception of application message flows, and exception capture mechanisms, thereby completing the closed-loop automated black-box testing process. A common method for state recognition is an enhanced dynamic interface element recognition method that combines image recognition engines and optical character recognition technology.

[0003] The core architecture of the current railway dispatching centralized system (CTC) automated testing technology consists of an automatic test execution engine, an agent program, a CTC subsystem under test, and an external simulation system. Figure 1 The core architecture shown achieves functional decoupling. The automated test execution engine performs operations tailored to different test requirements and test logic, generates test results, analyzes results, customizes reports, compares and analyzes test results, and customizes and prints reports based on user needs. The test agent captures images, operates external system simulations, and sets test conditions. The external system simulation receives control operations from the agent and transmits the information back to the automated test execution engine.

[0004] During the test preparation phase, existing automated testing technologies use dynamic condition exploration algorithms to construct and establish object-relational topology models and automatically generate test scenarios. They then use a relational multi-table database design method to dynamically store test data, record hash verification, data integrity protection, and data traceability throughout the entire test process.

[0005] During testing, the execution engine transmits test instructions to the agent program via a dual-channel protocol. The agent then utilizes a triple combination of logic operations, data comparison, and image recognition to simultaneously handle image information parsing and CTC system status verification. The agent program's parallel control technology and an environmental reset function control the test cycle for each test. The test process utilizes a closed-loop feedback mechanism, dynamically adjusting the CTC subsystem configuration data based on image recognition results, ensuring test scenario coverage and adaptive verification of the CTC subsystem under test.

[0006] The current automated testing technology for the Centralized Railway Dispatching System (CTC) uses a triple-combination of logical operations, data comparison, and image recognition to parse image information. The control recognition process is complex and unable to promptly respond to complex situations such as pop-up drop-down boxes for interface controls or overlapping drawings on the interface when updating lists.

[0007] Furthermore, current approaches to image information parsing are only suitable for subsystems with simple interface graphical layouts, not for subsystems with complex interface graphical layouts. Existing automated testing technologies, such as test execution engines and agents, focus on automating data testing, while the accompanying object-relational topology models are unsuitable for parsing complex interface graphical layouts. Consequently, automated support for graphical interface human-computer interaction testing is lacking at the architectural level. Summary of the Invention

[0008] The purpose of the present invention is to provide an automated method and system for black-box testing of complex graphical interfaces, which are used for black-box testing of complex graphical interfaces in railway dispatching centralized systems. Since the existing technology lacks automated support for graphical interface human-computer interaction testing at the architectural level, the present invention designs a preloadable control relationship data structure and a supporting control state identification and operation method to form an automated method and system for black-box testing of complex graphical interfaces in CTC systems, thereby supplementing the shortcomings of the existing technology.

[0009] A first aspect of the present invention is to provide a complex graphical interface black box testing automation method for a railway dispatching centralized system, comprising:

[0010] S1, calling the positioning module to accurately identify the control position in the software interface to generate positioning data;

[0011] S2, reading test data stored externally, and calling an execution module to simulate an input device to operate a control according to a data type of the test data, and / or calling a verification module to check a status of a software interface control; wherein the test data includes the positioning data.

[0012] Preferably, the S2 includes:

[0013] 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;

[0014] S22, simulating the action of the vehicle dispatching personnel changing the system interface or control state by operating the mouse and / or keyboard based on the combined structure of the positioning module and the execution module; and

[0015] S23, based on the verification module simulating the human eye to confirm and check whether the control status complies with the normal process of driving dispatching business; wherein, the verification module forms a buffer content by caching the control status or control content to make a logical judgment on whether the action complies with the normal process of driving dispatching business.

[0016] Preferably, the behavioral 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.

[0017] Preferably, the calling of the positioning module in S1 to accurately identify the control position of the control in the software interface includes:

[0018] S11, calling a positioning module to construct a tree diagram of a computer display interface and preload the tree diagram of the computer display interface;

[0019] S12, storing the tree diagram of the computer display interface in a memory as the positions of all controls in the interface;

[0020] Wherein, the S11 includes:

[0021] (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 sibling relationship;

[0022] (2) identifying the relationships among all windows, panels, lists, and / or buttons in the computer display interface based on the positioning module to form a second relationship tree;

[0023] (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.

[0024] Preferably, the S22, based on the combined structure of the positioning module and the execution module, simulates the action of the driving dispatching staff changing the system interface or control state through mouse and / or keyboard operation; includes:

[0025] (1) Connect to the software process under test,

[0026] (2) Based on the execution module calling the cache content of the verification module, performing a specific operation according to the execution data and the operated object in the test data;

[0027] As a preferred embodiment, 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.

[0028] Preferably, performing a specific operation according to the execution data and the operated object in the test data includes:

[0029] A. If the operated object is a control identified by the positioning module, the execution module performs one or more of the following operations: moving the mouse over the control, left-clicking the control, right-clicking the control, inserting text at the cursor position in a text box, pressing a button control, maximizing or minimizing a window, selecting a list item or drop-down list item, and selecting or deselecting a check box;

[0030] B. If the object being operated is the software process under test, the execution module performs 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 based on the cache content, and performs the selection operation.

[0031] Preferably, the S23, based on the verification module simulating human eyes to confirm and check whether the control state complies with the normal process of the driving dispatch business; wherein the verification module forms a buffer content by caching the control state or control content to perform a logical judgment on whether the action complies with the normal process of the driving dispatch business includes:

[0032] (1) Based on the verification module, the control state changes caused by the execution module operation are verified, including:

[0033] 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 show options when clicked and collapses when selected, a selected item in a list box is highlighted, and a slider changes position when operated.

[0034] (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:

[0035] The number of verification data can be 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;

[0036] After all status checks pass, the verification module determines that the current status check verification has passed. If one status check fails, the current status check verification is considered failed.

[0037] If the state change meets the design expectations of the test case, the verification module extracts the text description of the verification passed from the verification record in the test data and records it in the test result. Otherwise, the module extracts the text description of the verification failed 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 search for sub-controls according to the cache content and perform the selection operation.

[0038] A second aspect of the present invention is to provide a complex graphical interface black box test automation system for a railway dispatching centralized system, for implementing the method of the first aspect, comprising:

[0039] A positioning module (101) is used to accurately identify the position of a control in a software interface and generate positioning data after being called;

[0040] An execution module (102) is used to read test data stored externally and simulate the operation of the input device on the control after calling according to the data type of the test data; wherein the test data includes the positioning data; and

[0041] The verification module (103) is used to check the status of the software interface control after calling.

[0042] A third aspect of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores a plurality of instructions, and the processor is configured to read the instructions and execute the method described in the first aspect.

[0043] A fourth aspect of the present invention provides a computer-readable storage medium, wherein 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 described in the first aspect.

[0044] Beneficial effects of the method and system of the present invention:

[0045] 1. Construct and store controls within a computer display interface as a tree diagram. Pre-load the locations of all controls in memory, enabling faster and more accurate control location compared to existing methods that parse image information. Organizing controls within complex graphical interfaces as a tree diagram and pre-loading it simplifies the control identification process and improves the real-time performance and accuracy of automated testing methods.

[0046] 2. Construct a complex graphical interface black box test automation system architecture 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 described in the present invention has the black box automation test function of the complex graphical interface subsystem.

[0047] 3. The construction method of the positioning module, execution module and verification module in the black box test automation system architecture of complex graphical interfaces, as well as the construction method of the test case table, test template table and test unit table of the black box test case of the railway dispatching centralized system, construct a black box test automation method and system suitable for complex interface graphic layout, so that the railway dispatching centralized system has the black box automation test function of the complex graphical interface subsystem. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in related technologies, the following briefly introduces the drawings required for use in the specific embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0049] Figure 1 A flow chart of a black box testing automation method for a complex graphical interface according to an embodiment of the present invention;

[0050] Figure 2 This is a principle architecture diagram of a complex graphical interface black box testing automation method provided according to an embodiment of the present invention;

[0051] Figure 3 A schematic diagram of data composition of a test step according to an embodiment of the present invention;

[0052] Figure 4 A schematic diagram of a tree diagram relationship structure of controls provided according to an embodiment of the present invention;

[0053] Figure 5 A plurality of test steps provided according to an embodiment of the present invention are constructed as a test unit schematic diagram;

[0054] Figure 6A flowchart of a method for constructing test cases, test templates, and test units according to an embodiment of the present invention;

[0055] Figure 7 This is an architecture diagram of a complex graphical interface black box test automation system provided according to an embodiment of the present invention;

[0056] Figure 8 A structural diagram of an electronic device provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0058] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0059] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed, detachable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediate medium; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances. Example 1

[0060] Figure 1 As shown, this embodiment provides a complex graphical interface black box testing automation method for a railway dispatching centralized system, including:

[0061] S1, calling the positioning module to accurately identify the control position in the software interface to generate positioning data;

[0062] S2, reading test data stored externally, and calling an execution module to simulate an input device (mouse or keyboard) to operate a control according to a data type of the test data, and / or calling a verification module to check a status of a software interface control; wherein the test data includes the positioning data.

[0063] As a preferred embodiment, the S2 includes:

[0064] S21, read the test data stored externally;

[0065] S22, simulating the action of the vehicle dispatching personnel changing the system interface or control state by operating the mouse and / or keyboard based on the combined structure of the positioning module and the execution module; and

[0066] S23, based on the verification module simulating the human eye to confirm and check whether the control status complies with the normal process of driving dispatching business; wherein, the verification module forms a buffer content by caching the control status or control content to make a logical judgment on whether the action complies with the normal process of driving dispatching business.

[0067] As a preferred embodiment, the test data in S21 consists of positioning data, execution data, verification data and verification records; wherein the positioning data is provided by the positioning module.

[0068] 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, wherein a single test step is composed of a data group formed by an execution data and multiple verification data, and 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 the test steps of the required behavioral characteristics of the software process under test. If a certain verification content in the behavioral characteristics of the software process under test is a verification failure, the black box test automation method loads the verification failure record into the external test result to form the verification record. If the verification content is a verification pass, the verification pass record is loaded.

[0069] As a preferred embodiment, Figure 2 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.

[0070] As a preferred embodiment, the calling of the positioning module in S1 to accurately identify the control position of the control in the software interface includes:

[0071] S11, calling a positioning module to construct a tree diagram of a computer display interface and preload the tree diagram of the computer display interface;

[0072] S12, storing the tree diagram of the computer display interface in a memory as positions of all controls in the interface.

[0073] As a preferred embodiment, the S11 includes:

[0074] (1) Based on the positioning module, the relationships between all controls in the computer display interface are identified to form a first relationship tree; wherein the relationships between all controls in the computer display interface are 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 between A and C are identified by the positioning module as parent-child relationships, and between B and C as sibling relationships.

[0075] (2) identifying the relationships among all windows, panels, lists, and / or buttons in the computer display interface based on the positioning module to form a second relationship tree;

[0076] (3) Constructing a tree diagram of a computer display interface based on the first relationship tree and the second relationship tree, such as Figure 4 As shown in the figure, controls in parent-child relationships are located at different levels in the tree diagram, while controls in sibling relationships are located at the same level in the tree diagram.

[0077] In this embodiment, Figure 4 In the tree diagram shown, the location of the control can be described as a path starting from the root node and passing through each level of window nodes and panel nodes until reaching the corresponding node of the specified control, that is, the progressive connection relationship between the parent node and the child node. Each positioning data in the test step uses the expression of "root > child node 1 > child node 2 > target node" to locate the specific control, such as Figure 4 The location data for Button 1 is Desktop > Window 3 > Panel 2 > Button 1, a progressive process starting from the root node of Desktop, passing through Window 3, Panel 2, and finally reaching the leaf node of Button 1. When identifying controls, the positioning module uses a black-box testing automation method to extract location data from the test data and then identify specific controls one by one based on the given information.

[0078] As a preferred embodiment, the S22, based on the combined structure of the positioning module and the execution module, simulates the action of the driving dispatching personnel changing the system interface or control state through mouse and / or keyboard operation; including:

[0079] (1) Connect to the software process under test,

[0080] (2) Based on Figure 2The execution module in the test module calls the cache content of the verification module and performs a specific operation according to the execution data and the operated object in the test data;

[0081] As a preferred embodiment, 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.

[0082] As a preferred embodiment, performing a specific operation according to the execution data and the operated object in the test data includes:

[0083] A. If the operated object is a control identified by the positioning module, the execution module performs one or more of the following operations: moving the mouse over the control, left-clicking the control, right-clicking the control, inserting text at the cursor position in a text box, pressing a button control, maximizing or minimizing a window, selecting a list item or drop-down list item, and selecting or deselecting a check box;

[0084] B. If the object being operated is the software process under test, the execution module performs 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 based on the cache content, and performs the selection operation.

[0085] As a preferred embodiment, the S23, based on the verification module simulating the human eye to confirm and check whether the control state complies with the normal process of the driving dispatch business; wherein the verification module forms a buffer content by caching the control state or control content to perform a logical judgment on whether the action complies with the normal process of the driving dispatch business includes:

[0086] (1) Based on Figure 2 The validation module in the validation module verifies the control state changes caused by the execution module operation, including:

[0087] 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 show options when clicked and collapses when selected, a selected item in a list box is highlighted, and a slider changes position when operated.

[0088] (2) Based on Figure 2 The verification module in the test data checks whether the change of the control state meets the design expectations of the test case based on the verification data in the test data, including:

[0089] The number of verification data can be 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;

[0090] After all status checks pass, the verification module determines that the current status check verification has passed. If one status check fails, the current status check verification is considered failed.

[0091] If the state change meets the design expectations of the test case, the verification module extracts the text description of the verification passed from the verification record in the test data and records it in the test result. Otherwise, the module extracts the text description of the verification failed 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 search for sub-controls according to the cache content and perform the selection operation.

[0092] Figure 2 The system architecture can process the positioning data, execution data and verification data in a single test step, and can also process the test data of multiple test steps. The black box test automation method divides the test steps of the software process under test into Figure 5 The combination shown is a test unit. Figure 5 Each test step involves operating the software under test, verifying state changes, and recording test results. The combination of multiple test steps constitutes a test unit. Black-box test automation methods load test data from multiple test steps into the system architecture and process them sequentially, completing the black-box automated testing process for the test unit setup.

[0093] As a preferred embodiment, 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 Figure 6 The test template is constructed in the manner shown, wherein a combination of multiple test units constitutes a test template, and a combination of multiple test templates constitutes a test case. Figure 6 In this approach, different test templates can reuse the same test units, and different test cases can reuse the same test template. This allows black-box test automation methods to flexibly construct test cases by adjusting the combination method to meet different black-box testing needs. After the black-box test automation method executes all the test units in a single test case, the test result record generated is the automated test result of the test case. Example 2

[0094] like Figure 7 As shown, this embodiment provides a complex graphical interface black box test automation system for a railway dispatching centralized system, which is used to implement the method of embodiment 1, including:

[0095] Positioning module 101, used to accurately identify the control position in the software interface to generate positioning data after being called;

[0096] An execution module 102 is configured to read test data stored externally and simulate the operation of an input device (mouse or keyboard) on a control after calling the module according to the data type of the test data; wherein the test data includes the positioning data; and

[0097] The verification module 103 is used to check the status of the software interface controls after calling.

[0098] The present invention also provides a memory storing a plurality of instructions, wherein the instructions are used to implement the method as in the first embodiment.

[0099] like Figure 8 As 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, and the instructions can be loaded and executed by the processor to enable the processor to execute the method as in embodiment 1.

[0100] Application Examples

[0101] This paper demonstrates the black-box test automation method and system implementation details, using the execution process of a single test case in the railway dispatching centralized system subsystem as an example. The software process under test is the dispatching command subsystem of the railway dispatching centralized system. The test case-related tabular data is shown in Tables 1, 2, 3, and 4. Tables 1 and 2 represent the test case table and test template table, respectively. Tables 3 and 4 represent the unit data portion and module application data portion 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.

[0102] Table 1 Test case table

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

[0104] Table 2 Test template table

[0105] Template number Template Description Unit sequence 1 Create a new dispatching order, including the station and locomotive receiving point 1,2; 14 After configuring QueryCmdCopy=1 in Order.ini, restart the software process under test 17,6; 15 Switch the current cache box panel to the first entry in the query command window 19,23,18;

[0106] Table 3 Test unit table (unit data part)

[0107]

[0108] Table 4 Test unit table (module application data part)

[0109]

[0110] The black-box test automation method first constructs and stores a tree diagram of the computer display interface and preloads it. It then refines test case 1 in Table 1 into test template 1, test template 14, and test template 15. Test template 1 sequentially contains test units 1 and 2, test template 2 sequentially contains test units 17 and 6, and test template 15 sequentially contains test units 19, 23, and 18. During this process, the black-box test automation method generates test results and stores them in the test result table.

[0111] The black-box test automation method handles step 1 of test unit 1. The location module locates the refresh button from the root node based on the tree diagram, and the execution module performs a press operation. After the press operation is performed, the verification module checks whether the new button on the same panel is enabled and the refresh button is grayed out. The verification result shows that the new button is enabled and the refresh button is grayed out. The verification module records the corresponding verification pass statement in the test results.

[0112] The black box test automation method processes step 2 of test unit 1. The positioning module locates the new button from the root node according to the tree diagram, and the execution module performs the pressing operation.

[0113] The black box test automation method processes step 3 of test unit 1. The positioning module locates the entry of type 5 in the drop-down box of the scheduling command subsystem from the root node according to the tree diagram, and the execution module performs the selection operation.

[0114] The black box test automation method processes step 4 of test unit 1. The positioning module locates the entry with subtype 12 in the drop-down box of the scheduling command subsystem from the root node according to the tree diagram, and the execution module performs the selection operation.

[0115] The black box test automation method processes step 5 of the test unit 1, the positioning module locates the cache button from the root node according to the tree diagram, and the execution module performs the pressing operation.

[0116] The black box test automation method processes step 1 of test unit 2. The positioning module locates the entry of station 1 in the command point list from the root node according to the tree diagram, and the execution module performs the check operation.

[0117] The black box test automation method processes step 2 of test unit 2. The positioning module locates the entry of station 2 in the command point list from the root node according to the tree diagram, and the execution module performs the check operation.

[0118] The black box test automation method processes step 3 of test unit 2. The positioning module locates the cache button from the root node according to the tree diagram, and the execution module performs the pressing operation. After the pressing operation is performed, the positioning module locates the command number control from the root node, and then locates the entry where the first item in the cache box panel list is located. 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 the entry where the first item in the cache box panel list is located from the root node, and the verification module checks whether the first item in the cache box panel list is visible. The positioning module locates the command location control from the root node, and the verification module checks whether the control content of the command location control is empty. The verification result is 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 text of the command location is not empty. The verification module records the corresponding statement of the verification in the test result.

[0119] The black box test automation method processes the test unit 17 step 1, the black box test automation method operates the configuration file 1 in the main program directory, and the execution module performs the modification of the local file configuration operation.

[0120] The black box test automation method processes step 2 of the test unit 17. The black box test automation method operates the software process under test in the main program directory, and the execution module executes the operation of restarting the software process under test.

[0121] The black box test automation method processes step 1 of test unit 6. The positioning module locates the user name control of the login interface from the root node according to the tree diagram, and the execution module executes the operation of inserting the user name string text.

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

[0123] The black box test automation method processes step 3 of test unit 6. The positioning module locates the login button of the login interface from the root node according to the tree diagram, and the execution module executes the operation of pressing the login button.

[0124] The black box test automation method processes step 4 of test unit 6. The positioning module locates the main interface of the scheduling command subsystem from the root node according to the tree diagram, and the execution module executes the scheduling command subsystem window maximization operation.

[0125] In step 1 of test unit 19, the black-box test automation method processes the following steps: the positioning module locates the query command tab from the root node based on the tree diagram, and the execution module performs an operation by moving the mouse over the control. After the operation is performed, the positioning module locates the first item in the cache panel list from the root node. The verification module extracts the content of the first item in the cache panel list and caches it. The verification result is a pass in extracting the first command number from the cache panel. The verification module records the corresponding statement of verification in the test results.

[0126] The black box test automation method processes the test unit 23 step 1, the positioning module locates the query command check box from the root node according to the tree diagram, and the execution module executes the check box selection operation.

[0127] The black box test automation method processes the test unit 18 step 1, the positioning module locates the query button from the root node according to the tree diagram, and executes the query button pressing operation.

[0128] The black box test automation method processes step 2 of the test unit 18. The positioning module locates the query list from the root node according to the tree diagram, and the execution module calls the cache content of the verification module, searches for the corresponding entry in the query list according to the cache content and performs the selection operation.

[0129] In step 3 of test unit 18, the black-box test automation method processes: the location module locates the conversion button from the root node based on the tree diagram, and the execution module executes the operation of pressing the conversion button. After the operation of pressing the conversion button is executed, the location 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 caches them. The verification result is that the number of entries in the cache box panel list has been extracted, and the verification module records the corresponding verification result in the test result.

[0130] The black-box test automation method processes step 4 of test unit 18. The positioning module locates the query command tab from the root node based on the tree diagram, and the execution module moves the mouse over the control. After moving the mouse over the control, the positioning module locates the cache box panel list from the root node. The verification module extracts the number of entries in the cache box panel list and compares it with the cache contents to verify whether the number of entries increases by 1 relative to the cached number. The verification result indicates that the number of entries does not match the cached number, indicating that the scheduling command conversion has failed. The verification module records the verification failure statement in the test results. The black-box test automation method is completed, and the test results are shown in Table 5.

[0131] Table 5 Test results

[0132] Result No. Unit number Step Number Test results Testing Log 1 1 1 pass The New button is available, pass; the Refresh button is automatically grayed out, pass; 2 2 3 pass The command numbers of the cache box panel and the main panel are the same, passed; the first command in the cache box panel is visible, passed; the text in the command location is not empty, passed; 3 19 1 pass Extract the first command number of the cache box panel through; 4 18 3 pass Extract the number of entries in the cache box panel list through; 5 18 4 fail Scheduling command conversion, failed;

[0133] 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 it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, 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 testing automation method for railway dispatching centralized system, characterized by: include: S1, calling the positioning module to accurately identify the control position in the software interface to generate positioning data; S2, reading test data stored externally, and calling an execution module to simulate an input device to operate a control according to a data type of the test data, and / or calling a verification module to check a status of a software interface control; wherein the test data includes the positioning data; 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, based on the combined structure of the positioning module and the execution module, simulating the action of the driving dispatching personnel changing the system interface or control state through mouse and / or keyboard operation, including: (1) Connect to the software process under test, (2) Based on the execution module calling the cache content of the verification module, 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 on a software interface; and S23, based on the verification module simulating human eyes to confirm and check whether the control state conforms to the normal process of the driving dispatch business; wherein the verification module caches the control state or control content to form a buffer content to perform a logical judgment on whether the action conforms to the normal process of the driving dispatch business; 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. The calling of the positioning module in S1 to accurately identify the control position of the control in the software interface includes: S11, calling a positioning module to construct a tree diagram of a 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 sibling relationship; (2) identifying the relationships among 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.

2. The method for automating black box testing of a complex graphical interface according to claim 1, characterized in that: The performing of a specific operation according to the execution data and the operated object in the test data includes: A. If the operated object is a control identified by the positioning module, the execution module performs one or more of the following operations: moving the mouse over the control, left-clicking the control, right-clicking the control, inserting text at the cursor position in a text box, pressing a button control, maximizing or minimizing a window, selecting a list item or drop-down list item, and selecting or deselecting a check box; B. If the object being operated is the software process under test, the execution module performs 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 based on the cache content, and performs the selection operation.

3. The complex graphical interface black box test automation method according to claim 2, characterized in that: The S23, based on the verification module simulating human eyes to confirm and check whether the control state complies with the normal process of the driving dispatch business; wherein the verification module caches the control state or control content to form a buffer content to perform a logical judgment on whether the action complies with the normal process of the driving dispatch 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 show options when clicked and collapses when selected, a selected item in a list box is highlighted, 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 can be 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 pass, the verification module determines that the current status check verification has passed. If one status check fails, the current status check verification is considered failed. If the state change meets the design expectations of the test case, the verification module extracts the text description of the verification passed from the verification record in the test data and records it in the test result. Otherwise, the module extracts the text description of the verification failed 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 search for sub-controls according to the cache content and perform the selection operation.

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

5. 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 configured to read the instructions and execute the method according to any one of claims 1 to 3.

6. 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 3.

Citation Information

Patent Citations

  • Automatic black box testing method based on graphical user interface

    CN113704125A