Test result determination method and apparatus
By acquiring interface size adjustment information and interface position offset information, the problem of inaccurate control positions in UI automation testing was solved, enabling high-precision automation testing on different platforms.
Patent Information
- Application Number
- CN202210572203.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-05-24
AI Technical Summary
Existing UI automation testing technologies cannot accurately locate the corresponding control positions on different platforms, resulting in low testing accuracy.
By acquiring the interface size adjustment information and interface position offset information of the device under test, the current position of the target control is determined, and this information is sent to the driver device to generate test results.
This improves the accuracy of determining control position information across different platforms, thereby improving the accuracy of determining automated test results.
Smart Images

Figure CN117149611B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, specifically relating to a method and apparatus for determining test results. Background Technology
[0002] In related technologies, for automated testing on mobile terminals, test scripts can be generated in advance, and interface automated testing (i.e., UI automated testing) can be performed using the test scripts and automated testing tools installed on the mobile terminal.
[0003] However, the UI automation testing process in related technologies cannot accurately locate the corresponding control positions on different platforms, resulting in low accuracy of UI automation testing. Summary of the Invention
[0004] To address the aforementioned problems, this application provides a method and apparatus for determining test results.
[0005] On the one hand, this application proposes a method for determining test results, the method comprising:
[0006] Receive test information sent by the driver device based on the test script;
[0007] When the test information is used to indicate that the operation of the first interface is to be tested, the interface size adjustment information and interface position offset information corresponding to the current interface in the local device under test are obtained; the operation complexity of the first interface operation is less than a preset complexity threshold.
[0008] Based on the interface size adjustment information and the interface position offset information, the current position information of the target control is determined; the target control is the control required to perform the operation on the first interface.
[0009] The current location information is sent to the driving device so that the driving device generates a first test result of the first interface operation based on the current location information.
[0010] On the other hand, embodiments of this application provide a method for determining test results, the method comprising:
[0011] The test script is executed, and test information is sent to the device under test. If the test information indicates that a test of the first interface operation is to be performed, the device under test is made to obtain interface size adjustment information and interface position offset information corresponding to the current interface in the device under test. The operation complexity of the first interface operation is less than a preset complexity threshold. The device under test is also made to determine the current position information of the target control based on the interface size adjustment information and the interface position offset information. The target control is the control required to perform the test of the first interface operation.
[0012] Receive the current location information sent by the device under test;
[0013] Based on the current location information, a first test result for the operation of the first interface is generated.
[0014] On the other hand, embodiments of this application provide a test result determination apparatus, the apparatus comprising:
[0015] The test information receiving module is used to receive test information sent by the driver device based on the test script;
[0016] The offset information acquisition module is used to acquire interface size adjustment information and interface position offset information corresponding to the current interface in the local device under test when the test information indicates that the operation of the first interface is to be tested; the operation complexity of the first interface operation is less than a preset complexity threshold.
[0017] The current position information determination module is used to determine the current position information of the target control based on the interface size adjustment information and the interface position offset information; the target control is the control that needs to be operated to test the operation of the first interface.
[0018] The current location information sending module is used to send the current location information to the driving device, so that the driving device generates a first test result of the first interface operation based on the current location information.
[0019] On the other hand, embodiments of this application provide a test result determination apparatus, the apparatus comprising:
[0020] A test information sending module is used to execute a test script and send test information to the device under test (DUT). When the test information indicates that a test of a first interface operation is to be performed, the DUT is configured to obtain interface size adjustment information and interface position offset information corresponding to the current interface in the DUT. The operation complexity of the first interface operation is less than a preset complexity threshold. The DUT is also configured to determine the current position information of a target control based on the interface size adjustment information and the interface position offset information. The target control is the control required to perform the test of the first interface operation.
[0021] The current location information receiving module is used to receive the current location information sent by the device under test;
[0022] The first test result generation module is used to generate a first test result for the first interface operation based on the current location information.
[0023] On the other hand, this application proposes an electronic device for determining test results, the electronic device including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the test result determination method as described above.
[0024] On the other hand, this application proposes a computer-readable storage medium storing at least one instruction or at least one program, which is loaded and executed by a processor to implement the test result determination method as described above.
[0025] On the other hand, this application proposes a computer program product, including a computer program that, when executed by a processor, implements the test result determination method described above.
[0026] The test result determination method and apparatus proposed in this application receive test information sent by a test script executed by a driver device. When the test information indicates that a test of a first interface operation is to be performed, the method acquires interface size adjustment information and interface position offset information corresponding to the current interface in the local device under test. Based on the interface size adjustment information and interface position offset information, the method determines the current position information of the target control to be operated on for testing the first interface operation, wherein the operation complexity of the first interface operation is less than a preset complexity threshold. The method then sends the current position information to the driver device, so that the driver device generates a first test result for the first interface operation based on the current position information. Because this application embodiment can determine the control position information based on the interface size adjustment information and interface position offset information corresponding to the current interface in the local device under test, and because the interface size adjustment information and interface position offset information differ across platforms, different positioning methods can be used to accurately locate the corresponding control position for different platforms. This improves the accuracy of determining the control position information on different platforms, and consequently improves the accuracy of determining the automated test results on different platforms. Attached Figure Description
[0027] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 This is a schematic diagram illustrating the implementation environment of a test result determination method according to an exemplary embodiment.
[0029] Figure 2This is a flowchart illustrating a method for determining test results according to an exemplary embodiment. Figure 1 .
[0030] Figure 3 This is a block diagram illustrating an automated testing method according to an exemplary embodiment.
[0031] Figure 4 This is a schematic diagram illustrating a process for obtaining interface size adjustment information corresponding to the current interface in a device under test, according to an exemplary embodiment.
[0032] Figure 5 This is a schematic diagram illustrating a process for obtaining interface position offset information corresponding to the current interface in a device under test, according to an exemplary embodiment.
[0033] Figure 6 This is a flowchart illustrating a method for determining test results according to an exemplary embodiment. Figure 2 .
[0034] Figure 7 This is a flowchart illustrating a method for determining test results according to an exemplary embodiment. Figure 3 .
[0035] Figure 8 This is a flowchart illustrating a method for determining test results according to an exemplary embodiment. Figure 4 .
[0036] Figure 9 This is a flowchart illustrating a method for determining test results according to an exemplary embodiment. Figure 5 .
[0037] Figure 10 This is a block diagram of a test result determination device according to an exemplary embodiment.
[0038] Figure 11 This is a block diagram of another test result determination apparatus according to an exemplary embodiment.
[0039] Figure 12 This is a hardware structure block diagram of a server determined by test results according to an exemplary embodiment. Detailed Implementation
[0040] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0041] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0042] Figure 1 This is a schematic diagram illustrating the implementation environment of a test result determination method according to an exemplary embodiment. For example... Figure 1 As shown, the implementation environment may include at least a driving device 01 and a device under test 02. The driving device 01 and the device under test 02 may be directly or indirectly connected by wired or wireless communication, which is not limited in this application.
[0043] Optionally, the driver device 01 can be used to write test scripts and execute test scripts to send test information to the device under test; to receive the current position information of the target control sent by the device under test; and to generate a first test result of the first interface operation based on the current position information. Optionally, the driver device 01 can be a smartphone, tablet computer, laptop computer, desktop computer, smart TV, smartwatch, etc., but is not limited to these.
[0044] Optionally, the device under test (DUT) 02 can include, but is not limited to, Android devices, iOS devices, and personal computers (PC devices), where iOS refers to the mobile operating system developed by Apple Inc. The DUT can be configured with an automated testing framework, the application under test, and the engine corresponding to the application under test. Since the automated testing framework may not support iOS devices and PC devices, to enable the same test script to control automated testing on different DUT devices, an iOS-side automated framework (e.g., WDA) and the corresponding application programming interface (API) for PC devices (e.g., Win32API) can be integrated into the automated testing framework. Simultaneously, some common UI operations can be generalized across different platforms to support the same test script achieving the same functionality on different DUT devices. Here, WDA refers to the official iOS-side automated framework provided by Facebook, and Win32API refers to the application programming interface for Microsoft 32-bit platforms; Win32 refers to the 32-bit environment of the Microsoft Windows operating system. Furthermore, a software development kit (SDK) plugin can be pre-integrated into the engine to create a nested socket port. The driver device 01 can communicate with the device under test 02 through this Socket port. For example, the driver device 01 can send test information to the device under test 02 through this Socket port.
[0045] Specifically, the device under test (DUT) can be used to acquire interface size adjustment information and interface position offset information of the current interface when the test information indicates that the operation of the first interface is to be tested; and to determine the current position information of the target control based on the interface size adjustment information and interface position offset information; and to send the current position information to the driving device. Optionally, the DUT 02 can be a smartphone, tablet computer, laptop computer, desktop computer, smart TV, smartwatch, etc., but is not limited to these.
[0046] It should be noted that, Figure 1 This is merely an exemplary implementation environment diagram. Other implementation environments may be included in other scenarios.
[0047] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0048] Figure 2 This is a flowchart illustrating a method for determining test results according to an exemplary embodiment. Figure 1 This method can be used for Figure 1In the implementation environment described in this specification, the method operation steps are as illustrated in the embodiments or flowcharts. However, based on conventional or non-inventive labor, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual system or server products, the method can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment) as shown in the embodiments or drawings. Specifically, as shown in the embodiments or drawings... Figure 2 As shown, the method may include:
[0049] S101. The driver executes the test script and sends test information to the device under test.
[0050] Optionally, the driver device controls the automated testing process. Responding to test script writing instructions, it writes and executes test scripts in a target scripting language to send test information to the device under test. As an example, the target scripting language could be Python, and the test information could be command fields and parameters used for automated testing. Python is a high-level scripting language that combines interpreted, compiled, interactive, and object-oriented features.
[0051] Optionally, in step S101 above, after the driver device executes the test script, it can send test information to the device under test in various ways, and this application embodiment does not specifically limit this. Figure 3 This is an automated testing block diagram illustrated according to an exemplary embodiment, such as... Figure 3 As shown, the driver device can send the test information to the device under test through the aforementioned Socket port.
[0052] S103. When the above test information is used to indicate that the operation of the first interface is to be tested, the device under test obtains the interface size adjustment information and interface position offset information corresponding to the current interface in the device under test.
[0053] Continue as Figure 3As shown, in step S103 above, after the device under test (DUT) receives the test information sent by the driver device through the aforementioned Socket port, the automated testing framework in the DUT can place the received test information in a test information queue. When the test information is a command, the test information queue can be a command queue (CommandHandle). The automated testing framework in the DUT can parse the test information in the test information queue and distinguish whether the test is for the first interface operation or the second interface operation based on the parsing result. As an example, the operation complexity of the first interface operation is less than a preset complexity threshold, and it can be a commonly used UI operation or some fixed UI operations. For example, operations such as obtaining the name of the current terrain (world) or obtaining the current control layout in a game scene. If the test is for the first interface operation, the automated testing framework in the DUT can obtain the interface size adjustment information and interface position offset information corresponding to the current interface in the DUT, thereby locating the control position information and completing the automated testing of commonly used UI operations or some fixed UI operations. As another example, the complexity of the second interface operation is greater than or equal to the preset complexity threshold. This can be a more complex operation beyond the basic UI operations or some fixed UI operations. For instance, in a first-person shooter (FPS) game, in-game actions such as controlling character movement and dealing damage are required. If the test is of the second interface operation, the automated testing framework in the device under test can call functions in the engine corresponding to the application under test to automate the testing of more complex UI operations.
[0054] Optionally, the application under test can include, but is not limited to, game applications, video applications, etc. If the application under test is a game application, the corresponding engine can be the game engine that runs the application. For example, the game engine can include, but is not limited to, Unreal Engine (e.g., UE4), Unity Engine, Cocos2d Engine, etc. Unreal Engine is a game engine developed by Epic Games; it is a cross-platform game engine that can be used to develop single-player games for Windows, macOS, and Linux platforms, or games for iOS and Android mobile devices. Unity Engine is an engine developed by Unity Technologies for use in 3D scenes, such as in 3D video games and 3D animations. Cocos2d Engine is an open-source framework based on the MIT license, used for building games, applications, and other graphical user interface interactions.
[0055] Taking a game application as an example, the automated testing framework can be Gautomator, which is an automated testing framework specifically designed for mobile games. Gautomator can integrate an SDK into the project code, communicate with the SDK outside the game, and control the game to execute tests. Optionally, the game application can include, but is not limited to: 2D game applications, 3D game applications, virtual reality game applications, augmented reality game applications, and mixed reality game applications.
[0056] Optionally, the current interface may refer to the interface that the device under test can display. The interface size adjustment information may refer to interface size scaling information, that is, information on shrinking or enlarging the interface size. The interface position offset information may refer to changes in the interface position.
[0057] Optionally, in step S103 above, multiple methods can be used to obtain the interface size adjustment information and interface position offset information corresponding to the current interface in the device under test. This application embodiment does not specifically limit this.
[0058] In one embodiment, in step S103 above, the device under test (DUT) is equipped with an application under test (AUT), and the DUT obtains interface size adjustment information corresponding to the current interface in the DUT, which may include:
[0059] The device under test obtains the interface size adjustment information from the scaling factor attribute in the engine corresponding to the application under test.
[0060] Optionally, the device under test can be an iOS device. For iOS devices, the scaling factor can be identified using dots per inch (DPI) as an example. The scaling factor for iOS DPI is shown in Table 1.
[0061] Table 1. Coefficients for iOS DPI scaling ratio
[0062]
[0063] For iOS devices, in another implementation, taking a game as an example, since games may change the dpi scaling ratio due to some optimizations, in order to improve the accuracy of obtaining interface size adjustment information and thus improve the accuracy of automated testing, the automated testing framework in the device under test can call the SDK to obtain the scaling factor attribute (Mobile Content Scale Factor) in the engine corresponding to the application under test, thereby obtaining the interface size adjustment information.
[0064] In another implementation, Figure 4This is a schematic diagram illustrating a process for obtaining interface size adjustment information corresponding to the current interface in a device under test, according to an exemplary embodiment. Figure 4 As shown, in step S103 above, the device under test (DUT) is equipped with an application under test (AUT). The DUT obtains interface size adjustment information corresponding to the current interface in the DUT, which may include:
[0065] S201. The device under test obtains the viewport size information of the engine corresponding to the application under test, as well as the actual size information of the rendering window corresponding to the engine in the current interface.
[0066] S203. The device under test determines the interface size adjustment information based on the actual size information and the viewport size information.
[0067] Optionally, if the device under test is an Android device, then in S201 above, the automated testing framework in the device under test can call the SDK to obtain the viewport size information (i.e., the original Viewport Size) of the engine corresponding to the application under test, and use the surface size interface (e.g., the Calculate Surface Size interface) to obtain the actual size information of the rendering window corresponding to the engine in the current interface. Here, the viewport size information refers to the size information of the engine's visible area, the actual size information refers to the size information occupied by the rendering window corresponding to the engine in the overall layout of the current interface, and the rendering window refers to the window used to render objects.
[0068] Optionally, in step S203 above, the automated test framework in the device under test can compare the actual size information and the viewport size information to obtain the interface size adjustment information. For example, the automated test framework can calculate the ratio between the actual size information and the viewport size information, and determine the interface size adjustment information based on the ratio.
[0069] In another feasible implementation, when the device under test is a PC, the interface size adjustment information corresponding to the current interface of the PC can be set to 1 by default.
[0070] In this embodiment, for Android devices, the interface size adjustment information is determined based on the viewport size information of the engine and the actual size information of the rendering window corresponding to the engine in the current interface. This method can determine the interface size adjustment information in a way suitable for Android devices, which is compatible with the size adjustment information of different devices and improves the accuracy of determining the interface size adjustment information of Android devices. This, in turn, improves the accuracy of determining the control position information and thus improves the accuracy of determining the automated test results.
[0071] In an optional embodiment, Figure 5This is a schematic diagram illustrating a process for obtaining interface position offset information corresponding to the current interface in a device under test, according to an exemplary embodiment. Figure 5 As shown, in step S103 above, the device under test (DUT) is equipped with an application under test (AUT). The DUT obtains the interface position offset information corresponding to the current interface in the DUT, which may include:
[0072] S301. The device under test obtains the interface layout information of the current interface.
[0073] Optionally, for Android devices, due to the notch or chin design, the position of the rendering window may be offset relative to the actual position information obtained from the engine. To determine the interface position offset information of the Android device, in S301 above, the automated testing framework in the device under test can use the UI hierarchy acquisition instruction (uiautomator dump instruction) of the current interface to call the SDK to obtain the interface layout information of the current interface. For example, this interface layout information is used to describe the overall and local conditions of the current interface in the device under test. For instance, this interface layout information can be the layout XML file of the current interface.
[0074] S303. The device under test obtains the first position information of the rendering window corresponding to the engine from the engine corresponding to the application under test.
[0075] Optionally, in step S301 above, the automated testing framework in the device under test can call the SDK to obtain the first position information of the rendering window corresponding to the engine from the engine. The first position information is used to characterize the actual position information of the rendering window obtained from the engine.
[0076] S305. The device under test parses the interface layout information to obtain the second position information of the rendering window in the current interface.
[0077] Optionally, in step S305 above, the automated testing framework in the device under test can parse the interface layout information to obtain the overall distribution of the interface. This overall distribution may include, but is not limited to, window distribution and control distribution. Based on this overall distribution, the automated testing framework in the device under test can determine the second position information of the rendering window within the current interface, that is, determine where the rendering window is located in the overall distribution.
[0078] S307. The device under test determines the interface position offset information based on the first position information and the second position information.
[0079] Optionally, in step S307 above, the automated test framework in the device under test can determine the coordinate offset between the first position information and the second position information based on the coordinate information corresponding to the first position information and the coordinate information corresponding to the second position information, thereby obtaining the interface position offset information.
[0080] In this embodiment of the application, for Android devices, the interface position offset information is determined based on the interface layout information of the current interface and the first position information of the rendering window obtained from the engine corresponding to the application under test. This method can determine the interface position offset information in a way suitable for Android devices, which is compatible with the position offset information of different devices and improves the accuracy of determining the position offset information of Android devices. This, in turn, improves the accuracy of determining the control position information and thus improves the accuracy of determining the automated test results.
[0081] In an optional embodiment, the device under test (DUT) is provided with a preset application programming interface (API). The DUT's acquisition of the interface position offset information corresponding to the current interface in the DUT may include:
[0082] The device under test obtains interface position offset information based on a preset application programming interface.
[0083] Optionally, for PC devices, since a preset application programming interface (i.e., Win32API) is set in the automated testing framework in advance, the automated testing framework in the PC device can obtain interface position offset information caused by window title bars, operation bars, etc. based on the Win32API.
[0084] It should be noted that for iOS devices, the interface position offset information is negligible.
[0085] In this embodiment of the application, for PC devices, the interface position offset information caused by window title bars, operation bars, etc. can be obtained directly according to the preset application programming interface. The position offset information can be determined in a way suitable for PC devices, which is compatible with the position offset information of different devices, improves the determination accuracy of the position offset information of PC devices, thereby improving the determination accuracy of control position information, and further improving the determination accuracy of automated test results.
[0086] S105. The device under test determines the current position information of the target control based on the interface size adjustment information and the interface position offset information; the target control is the control that needs to be operated to test the operation of the first interface, and the operation complexity of the first interface operation is less than the preset complexity threshold.
[0087] Optionally, in step S105 above, the automated test framework in the device under test can determine the current position information of each control in the current interface based on the interface size adjustment information and the interface position offset information. Here, a control refers to a visual graphic "element" that can be placed on a form, such as a button or a file editing box. Each control in the current interface includes the target control required to perform the operation on the first interface. For example, if the first interface operation is clicking the login button, then the target control is the login control.
[0088] Optionally, embodiments of this application may use various methods to determine the current position information of the target control based on interface size adjustment information and interface position offset information, without making specific limitations.
[0089] In one implementation, Figure 6 This is a flowchart illustrating a method for determining test results according to an exemplary embodiment. Figure 2 ,like Figure 6 As shown, in step S105 above, the device under test is equipped with an application under test. The device under test determines the current position information of the target control based on the interface size adjustment information and the interface position offset information, which may include:
[0090] S1051. The device under test determines the scaled position information of the controls in the engine corresponding to the application under test in the current interface based on the interface size adjustment information; the controls in the engine include the target controls.
[0091] S1053. The device under test determines its current position information based on the scaled position information and the interface position offset information.
[0092] Optionally, in step S1051 above, the automated testing framework in the device under test can project the engine screen corresponding to the application under test onto the device under test to obtain a canvas. Since the size of the engine screen is inconsistent with the size of the current interface of the device under test, when projecting the engine screen onto the device under test, the size of the engine screen will be scaled according to the interface size adjustment information to obtain the scaled position information of the controls in the engine in the current interface. It should be noted that the controls in the engine include the target controls required for testing the operation of the first interface.
[0093] Optionally, in S1053 above, the automated testing framework in the device under test can determine the current location information in various ways, and this embodiment of the application does not specifically limit it.
[0094] In one implementation, the automated testing framework in the device under test can add the scaled position information to the interface position offset information to obtain the current position information.
[0095] In one implementation, the automated testing framework in the device under test can also determine the first weight of the scaled position information and the second weight of the interface position offset information based on the attribute information of the device under test, and calculate the first product of the scaled position information and the first weight, and the second product of the interface position offset information and the second weight. Then, the sum of the first product and the second product is calculated to obtain the current position information.
[0096] It should be noted that this current location information can be used to represent the current terrain of the target control's location, the target control's position and orientation within the current terrain, etc.
[0097] In this embodiment, since different devices under test have different scaling and offset information, the current position information of the target control is determined based on the interface size adjustment information and interface position offset information of the device under test. This allows for the precise positioning of the control using different positioning schemes for different devices, and is compatible with the scaling and offset of different devices. This improves the accuracy of determining the current position information of the target control, thereby improving the accuracy of determining the automated test results.
[0098] S107. The device under test sends its current location information to the drive device.
[0099] Optionally, in step S107 above, the device under test can send its current location information to the driver device through the Socket port.
[0100] S109. The aforementioned driving device generates a first test result for the first interface operation based on the current location information.
[0101] Optionally, in step S109 above, the driving device can generate the first test result of the first interface operation in various ways, and this application embodiment does not specifically limit this.
[0102] In one implementation, continue as follows Figure 6 As shown, in S109 above, the driving device generates a first test result of the first interface operation based on the current location information, which may include:
[0103] S1091. The aforementioned driving device obtains the control file tree of the current interface from the engine corresponding to the application under test; the aforementioned control file tree is used to represent the association between the attribute information and the position information of the control.
[0104] S1093. The aforementioned driving device determines the target position information of the target control based on the current position information, the control file tree, and the attribute information of the target control.
[0105] S1095. The aforementioned driving device controls the device under test to test the target control based on the target position information, and obtains the first test result.
[0106] Optionally, controls in the engine are typically arranged using a Graphical UI Designer (UMG) class to support the location lookup of subtypes of user widgets (UuserWidget), such as UpanelWidget, thereby obtaining a panoramic view of the scene. In step S1091 above, the driver device can call the SDK plugin to obtain the control file tree (i.e., dump_tree file) of the current scene from the engine corresponding to the application under test through depth traversal. The dump_tree file can be an XML-formatted control tree text, used to represent the association between control attribute information and control position information.
[0107] Optionally, since the aforementioned current location information is used to characterize the current terrain of the target control's location, the target control's position and orientation information within the current terrain, etc., in order to obtain accurate target location information corresponding to the target control, in step S1093, the driving device can determine the matching portion in the control file tree that matches the current location information based on the current location information, that is, determine the direction and other information of the current location information in the control file tree, and query the target location information of the target control from the matching portion based on the target control's attribute information, thereby realizing the positioning of the desired control in a relatively complex relationship and improving the accuracy of the target location information determination. For example, the attribute information may include, but is not limited to: control type information, control identifier information, control boundary position information, and control serial number information.
[0108] Optionally, in step S1095 above, the driving device can generate a first test command based on the target location information and send the first test command to the device under test (DUT) through the Socket port. The DUT responds to the first test command, operates the target control according to the control location information, and obtains a first test result for the first interface operation. The DUT sends the first test result to the driving device through the Socket port. The driving device can parse the first test result using a Python parser to obtain the actual test result. The driving device compares the difference between the actual test result and the expected result, generates a test report, and sends the test result to the relevant account.
[0109] In this embodiment, by searching the layout of UMG controls, the control file tree of the current structure is output, and the target position information of the target control can be accurately located using the control file tree. This supports the location search of extended subtypes, improves the accuracy of determining the target position information of the target control, and thus improves the accuracy of determining the automated test results.
[0110] In an optional embodiment, Figure 7 This is a flowchart illustrating a method for determining test results according to an exemplary embodiment. Figure 3 The above-mentioned device under test is equipped with an application under test, and the above-mentioned method may further include:
[0111] S401. When the above test information is used to indicate that the operation of the second interface is to be tested, the device under test calls the function in the engine corresponding to the application under test and obtains the function call result; the operation complexity of the second interface is greater than or equal to the preset complexity threshold.
[0112] Optionally, in step S401 above, after the device under test receives the test information sent by the driver device through the above-mentioned Socket port, it can first distinguish whether the test is for the operation of the first interface or the operation of the second interface based on the test information. If the test is for the operation of the second interface, the device under test can call the function in the engine corresponding to the application under test through the SDK plugin to obtain the function call result.
[0113] Optionally, embodiments of this application may call functions in the engine corresponding to the application under test in various ways to obtain function call results, without making specific limitations here.
[0114] In an optional implementation, the device under test (DUT) is equipped with a preset scripting language plugin corresponding to a preset scripting language. Before the DUT calls a function in the engine corresponding to the application under test and obtains the function call result, the method may further include the steps of generating and sending the target business logic. Specifically, the steps of generating and sending the target business logic may include:
[0115] The aforementioned driver is used to write the business logic of the application under test based on a preset scripting language to obtain the target business logic.
[0116] The aforementioned driving device sends the target business logic to the engine corresponding to the application under test.
[0117] The engine sends the target business logic to the preset virtual machine corresponding to the preset scripting language.
[0118] Optionally, a pre-defined scripting language plugin can be integrated into the automated testing framework of the device under test (DUT). After integration, the automated testing framework gains the ability to call the pre-defined scripting language interface. The driver device can respond to business logic editing commands, using the pre-defined scripting language to write the business logic of the application under test, thus obtaining the target business logic. The driver device can then send this target business logic to the engine corresponding to the application under test, which will then pass it to a pre-defined virtual machine for execution.
[0119] Taking a game application as the application under test and Gautomator as the automated testing framework, the default language can be Lua, a lightweight scripting language. A Lua plugin can be pre-integrated into the automated testing framework, giving it the ability to call Lua interfaces. The driver can then respond to business logic editing commands, writing the game application's business logic to obtain the target business logic. The driver can then send this target business logic to the game engine, which in turn sends it to the corresponding Lua virtual machine for execution.
[0120] In one implementation, in step S401 above, the device under test calls a function in the engine corresponding to the application under test to obtain the function call result, which may include:
[0121] During the execution of the target business logic in the aforementioned preset virtual machine, the device under test calls functions from the preset virtual machine based on a preset scripting language plugin and obtains the function call results.
[0122] Optionally, since a preset scripting language plugin is integrated into the automated testing framework in the device under test, the automated testing framework in the device under test can conveniently call functions from the preset virtual machine based on the preset scripting language plugin to obtain the function call results during the execution of the target business logic in the preset virtual machine.
[0123] Taking a game application as the application under test, Gautomator as the automated testing framework, and Lua as the default language, Gautomator can use the Lua plugin to call functions from the default virtual machine to parse and test the target business logic during the execution of the target business logic of the game application in the default virtual machine, and obtain the function call results.
[0124] In this embodiment, a preset scripting language plugin is set in the device under test. By embedding the preset scripting language plugin, functions and attribute values in the engine are called to perform automated testing, which improves the convenience and readability of engine function calls, thereby realizing the automated testing of complex UI operations in a convenient and accurate manner.
[0125] In another implementation, in step S401 above, the device under test calls a function in the engine corresponding to the application under test to obtain the function call result, which may include:
[0126] The device under test calls the function from the attribute system in the engine and obtains the function call result.
[0127] Optionally, the automated testing framework in the device under test can also utilize the reflection functionality of the function property system to dynamically call functions. That is, functions marked with `UFUNCTION` and variables marked with `UPROPERTY` in the project can be found in the engine's property system at runtime. For these functions already added to the property system, the automated testing framework in the device under test can directly call them for automated testing, thereby obtaining the function call results. Here, `UFUNCTION` refers to C++ functions recognizable by the UE4 reflection system, and `UPROPERTY` refers to variables exposed to the editor or blueprints. Variables marked with `UPROPERTY` are variables exposed to the editor or blueprints.
[0128] In this embodiment, functions marked with UFUNCTION and variables marked with UPROPERTY can be directly found in the engine's property system at runtime, which expands the way functions are called and improves the convenience, efficiency and accuracy of function calls, thereby improving the efficiency and accuracy of determining the function call results.
[0129] In another implementation, the test information is obtained based on a data packet format protocol. In step S401, the device under test calls a function in the engine corresponding to the application under test, which may include:
[0130] The device under test (DUT) parses the test information based on the data packet format protocol to obtain the data packet information corresponding to the data packet format protocol; the data packet information includes multiple functions.
[0131] The device under test executes multiple functions and obtains the function call results.
[0132] In this embodiment, engine functions that cannot be called in Lua can be invoked via JSON parsing, where JSON is a lightweight data exchange format. The implementation of JSON parsing for function invocation can be as follows: Design a data packet format protocol, write test information (e.g., commands, fields, etc.) according to this protocol, and send it to the device under test (DUT) through the aforementioned Socket port. After receiving the test information, the SDK plugin in the DUT parses the test information according to the data packet format protocol to obtain the data packet information corresponding to the protocol. The SDK plugin in the DUT then executes the multiple functions to obtain the function call results.
[0133] For example, the JSON format used by the data packet format protocol can be as follows:
[0134] 1) A data packet includes two fields: ops and out. ops is an array containing multiple operations, and out is a character used to specify the return value.
[0135] 2) Each operation is divided into static functions and non-static functions, distinguished by the static field (True or False). Each operation is named using the name field, and the return value is set using the name field of the operation.
[0136] 3) A static function includes the following fields: class (class name), package (package name), function (function name), and parms (parameters, which are an array).
[0137] 4) A non-static function includes the following fields: object (object name), function (function name), and parms (parameters, which are an array).
[0138] 5) During parsing, functions are executed sequentially according to the order of the array in ops. The return value of the preceding function can be entered as a parameter into the following function by adding '#' before name.
[0139] The following example illustrates calling a function via JSON parsing:
[0140] To obtain the location of a character in a game application, you can first obtain the World object, then input the return value into the static function GetPlayerCharacter, call GetPlayerCharacter to retrieve the character, and finally call the static function GetActorLocation to get the location. This can be accomplished by calling three static functions. GetPlayerCharacter is the static function that obtains the currently controlled character instance, and GetActorLocation is the static function that retrieves the character's location.
[0141] In this embodiment, engine functions that cannot be called in Lua are invoked through JSON parsing, which expands the scope of function calls and thus improves the applicability of automated testing.
[0142] S403. The device under test sends the function call result to the driver device.
[0143] Optionally, the device under test can send the result of the function call to the driver device through the aforementioned Socket port.
[0144] S405. The aforementioned driving device generates a second test result for the operation of the second interface based on the function call result.
[0145] Optionally, the driver device can parse the function call results using a Python parser to obtain the actual test results. The driver device then compares the differences between the actual test results and the expected results to generate a test report (i.e., a second test result). The driver device can also send this test report to the corresponding test account.
[0146] In a feasible embodiment, the type of the function call result is a relational table type. After the device under test calls the function from the preset virtual machine based on the preset scripting language plugin and obtains the function call result, the method may further include:
[0147] The device under test converts the type of the function call result from a relational table type to a string type to obtain the converted function call result.
[0148] Optionally, taking Lua as the default scripting language, since the result of a Lua function call may return more than one return parameter or a single variable, and the structure of a module in Lua is a relational table, the table type value can be converted to a string type when Lua returns a value, thus obtaining the converted function call result.
[0149] In one implementation, if the function call result includes multiple key-value pairs, the device under test converts the type of the function call result from a relational table type to a string type to obtain the converted function call result, which may include:
[0150] The device under test converts each of the key-value pairs into a string, resulting in the corresponding strings for each key-value pair.
[0151] The device under test is assembled by concatenating multiple key-value pairs and their corresponding strings to obtain the converted function call result.
[0152] Specifically, the table contains multiple key-value pairs (key:value). The automated testing framework in the device under test can read each key-value pair, convert it into characters, concatenate the characters corresponding to each key-value pair to obtain a character segment for each key-value pair, and then concatenate all the character segments corresponding to all key-value pairs into a long string, thus obtaining the converted function call result. By converting the relational table type to a string type, the problem of Lua calls not being able to return complex objects is solved, enabling Lua calls to return the required engine functions, thereby conveniently and accurately implementing automated testing of complex UI operations.
[0153] Accordingly, in step S403 above, the device under test sending the function call result to the driver device may include:
[0154] The device under test sends the converted function call result to the driver device.
[0155] Optionally, the device under test can send the converted function call result to the driver device through the aforementioned Socket port.
[0156] Accordingly, in S405 above, the driving device generates a second test result of the second interface operation based on the function call result, which may include:
[0157] The aforementioned driving device parses the converted function call result to obtain the target function call result.
[0158] The aforementioned test driver generates the aforementioned second test result based on the aforementioned target function call result.
[0159] Optionally, the driver device can use a general JSON parsing library to parse the converted function call result to obtain the target function call result. The driver device can then use a Python parser to parse the target function call result to obtain the actual test result. The driver device compares the difference between the actual test result and the expected result to generate a test report (i.e., the second test result). The driver device can also send this test report to the corresponding test account.
[0160] In this embodiment, the type of the function call result is converted from a relational table type to a string type to obtain the converted function call result. The converted function call result is then sent to the driver device, which parses it and generates a second test result. This solves the problem that Lua calls cannot return complex objects, enabling Lua calls to return the required engine functions. This allows for convenient and accurate automated testing of complex UI operations.
[0161] In one feasible embodiment, this application also discloses a test result determination system, which includes: a driving device and a device under test;
[0162] The driving device is used to drive the device to execute a test script and send test information to the device under test; and to receive current location information sent by the device under test; and to generate a first test result of the first interface operation based on the current location information.
[0163] The device under test (DUT) is configured to: acquire interface size adjustment information and interface position offset information corresponding to the current interface in the DUT when the test information indicates that a test of the first interface operation is to be performed; the operation complexity of the first interface operation is less than a preset complexity threshold; determine the current position information of a target control based on the interface size adjustment information and the interface position offset information; the target control is a control that needs to be operated to test the first interface operation; and send the current position information to the driving device.
[0164] The following describes the method for determining the test results, using the device under test as the subject:
[0165] Figure 8 This is a flowchart illustrating a method for determining test results according to an exemplary embodiment. Figure 4 .like Figure 8 As shown, the method for determining the test results may include:
[0166] S501. Receive test information sent by the driver device based on the test script;
[0167] S503. When the above test information is used to indicate that the operation of the first interface is to be tested, obtain the interface size adjustment information and interface position offset information corresponding to the current interface in the local device under test; the operation complexity of the above first interface operation is less than a preset complexity threshold.
[0168] S505. Based on the above interface size adjustment information and the above interface position offset information, determine the current position information of the target control; the above target control is the control that needs to be operated to test the above first interface operation;
[0169] S507. The current location information is sent to the driving device so that the driving device generates a first test result of the first interface operation based on the current location information.
[0170] In an optional embodiment, the local device under test includes an application under test. Determining the current position information of the target control based on the interface size adjustment information and the interface position offset information includes:
[0171] Based on the aforementioned interface size adjustment information, the scaled position information of the controls in the engine corresponding to the application under test in the current interface is determined; the controls in the engine include the target controls; the current position information is determined based on the scaled position information and the interface position offset information.
[0172] In an optional embodiment, the local device under test (DUT) is equipped with an application under test (AUT), and the acquisition of the interface size adjustment information corresponding to the current interface in the local DUT includes:
[0173] Obtain the viewport size information of the engine corresponding to the application under test and the actual size information of the rendering window of the engine in the current interface.
[0174] Based on the above actual size information and the above viewport size information, the above interface size adjustment information is determined.
[0175] In an optional embodiment, the device under test (DUT) is equipped with an application under test (AUT), and the acquisition of the interface position offset information corresponding to the current interface in the local DUT includes:
[0176] Obtain the interface layout information of the current interface;
[0177] Obtain the first position information of the rendering window corresponding to the engine of the application under test;
[0178] The above interface layout information is parsed to obtain the second position information of the rendering window in the current interface.
[0179] Based on the first position information and the second position information mentioned above, the interface position offset information is determined.
[0180] In an optional embodiment, the device under test (DUT) is provided with a preset application programming interface (API), and the acquisition of the interface position offset information corresponding to the current interface in the local DUT includes:
[0181] Based on the aforementioned preset application programming interface, the aforementioned interface position offset information is obtained.
[0182] In an optional embodiment, the device under test is provided with an application under test, and the method further includes:
[0183] When the above test information is used to indicate that the operation of the second interface is to be tested, the function in the engine corresponding to the application under test is called and the function call result is obtained; the operation complexity of the second interface operation is greater than or equal to the above preset complexity threshold.
[0184] The result of the above function call is sent to the above driver device, so that the driver device generates the second test result of the above second interface operation based on the result of the above function call.
[0185] In an optional embodiment, the device under test is equipped with a preset scripting language plugin corresponding to a preset scripting language. Before calling the function in the engine corresponding to the application under test and obtaining the function call result, the method further includes:
[0186] Based on the aforementioned pre-defined scripting language, the business logic of the application under test is written to obtain the target business logic;
[0187] The target business logic is sent to the engine corresponding to the application under test, so that the engine sends the target business logic to the preset virtual machine corresponding to the preset scripting language.
[0188] The above calls to functions in the engine corresponding to the application under test yield the following results:
[0189] During the execution of the target business logic in the aforementioned preset virtual machine, the aforementioned function is called from the aforementioned preset virtual machine based on the aforementioned preset scripting language plugin, and the result of the aforementioned function call is obtained.
[0190] In an optional embodiment, the type of the function call result is a relational table type. After the function is called from the preset virtual machine based on the preset scripting language plugin to obtain the function call result, the method further includes:
[0191] Convert the type of the above function call result from the above relational table type to the string type to obtain the converted function call result;
[0192] The above-mentioned function call result is sent to the driver device so that the driver device generates a second test result for the second interface operation based on the function call result, including:
[0193] The converted function call result is sent to the driver device so that the driver device can parse the converted function call result to obtain the target function call result; and the test driver device can generate the second test result based on the target function call result.
[0194] In an optional embodiment, the above-mentioned call to the function in the engine corresponding to the application under test, and the resulting function call, includes:
[0195] The function is called from the property system in the engine to obtain the result of the function call.
[0196] In an optional embodiment, the above test information is obtained based on a data packet format protocol, and the function call result obtained by calling the function in the engine corresponding to the application under test includes:
[0197] Based on the above data packet format protocol, the above test information is parsed to obtain the data packet information corresponding to the above data packet format protocol; the above data packet information includes multiple functions;
[0198] Execute the above functions to obtain the results of the function calls.
[0199] The following describes the method for determining the test results, using the drive device as the execution subject:
[0200] Figure 9 This is a flowchart illustrating a method for determining test results according to an exemplary embodiment. Figure 5 .like Figure 9 As shown, the method for determining the test results may include:
[0201] S601. Execute the test script and send test information to the device under test; when the test information is used to indicate that the operation of the first interface is to be tested, so that the device under test obtains the interface size adjustment information and interface position offset information corresponding to the current interface in the device under test; the operation complexity of the first interface operation is less than a preset complexity threshold; and so that the device under test determines the current position information of the target control according to the interface size adjustment information and the interface position offset information; the target control is the control that needs to be operated to test the operation of the first interface.
[0202] S603. Receive the current location information sent by the device under test;
[0203] S605. Based on the current location information mentioned above, generate the first test result of the first interface operation mentioned above.
[0204] In an optional embodiment, the device under test is equipped with an application under test, and the generation of a first test result for the first interface operation based on the current location information includes:
[0205] Obtain the control file tree of the current interface from the engine corresponding to the application under test; the control file tree is used to represent the relationship between the attribute information and the position information of the control;
[0206] Based on the current location information, the control file tree, and the attribute information of the target control, the target location information of the target control is determined.
[0207] Based on the target location information, the device under test is controlled to test the target control, and the first test result is obtained.
[0208] In an optional embodiment, the device under test is provided with an application under test, and the method further includes:
[0209] When the above test information is used to indicate that the operation of the second interface is to be tested, the function call result sent by the device under test is received; the function call result is obtained based on the device under test calling the function in the engine corresponding to the application under test, and the operation complexity of the second interface operation is greater than or equal to the preset complexity threshold.
[0210] Based on the above function call results, the second test results of the above second interface operation are generated.
[0211] Figure 10 This is a block diagram of a test result determination apparatus according to an exemplary embodiment. Figure 10 As shown, the device may include at least:
[0212] The test information receiving module 701 is used to receive test information sent by the driver device based on the test script;
[0213] The offset information acquisition module 703 is used to acquire the interface size adjustment information and interface position offset information corresponding to the current interface in the local device under test when the above test information is used to indicate that the operation of the first interface is to be tested; the operation complexity of the above first interface operation is less than a preset complexity threshold.
[0214] The current position information determination module 705 is used to determine the current position information of the target control based on the interface size adjustment information and the interface position offset information; the target control is the control that needs to be operated on to test the operation of the first interface.
[0215] The current location information sending module 707 is used to send the current location information to the driving device so that the driving device can generate the first test result of the first interface operation based on the current location information.
[0216] In an optional embodiment, the local device under test is equipped with an application under test, and the current location information determination module 705 may include:
[0217] The scaling position information acquisition unit is used to determine the scaled position information of the control in the engine corresponding to the application under test in the current interface based on the interface size adjustment information; the control in the engine includes the target control.
[0218] The current location information determination unit is used to determine the current location information based on the scaled location information and the interface location offset information.
[0219] In an optional embodiment, the local device under test is equipped with an application under test, and the aforementioned adjustment offset information acquisition module 703 may include:
[0220] The size information acquisition unit is used to acquire the viewport size information of the engine corresponding to the application under test and the actual size information of the rendering window corresponding to the engine in the current interface.
[0221] The interface size adjustment information determination unit is used to determine the interface size adjustment information based on the actual size information and the viewport size information.
[0222] In an optional embodiment, the device under test is equipped with an application under test, and the adjustment offset information acquisition module 703 may include:
[0223] The interface layout information acquisition unit is used to acquire the interface layout information of the current interface.
[0224] The first position information acquisition unit is used to acquire the first position information of the rendering window corresponding to the engine of the application under test.
[0225] The second position information acquisition unit is used to parse the above-mentioned interface layout information to obtain the second position information of the above-mentioned rendering window in the above-mentioned current interface.
[0226] The interface position offset information determination unit is used to determine the interface position offset information based on the first position information and the second position information.
[0227] In an optional embodiment, the device under test is provided with a preset application programming interface, and the aforementioned adjustment offset information acquisition module 703 may include:
[0228] The interface position offset information acquisition unit is used to acquire the interface position offset information based on the aforementioned preset application programming interface.
[0229] In an optional embodiment, the device under test is provided with an application under test, and the apparatus may further include:
[0230] The calling module is used to call the function in the engine corresponding to the application under test when the above test information indicates that the operation of the second interface is to be tested, and to obtain the function call result; the operation complexity of the above second interface operation is greater than or equal to the above preset complexity threshold.
[0231] The function call result sending module is used to send the function call result to the driver device so that the driver device can generate the second test result of the second interface operation based on the function call result.
[0232] In an optional embodiment, the device under test is provided with a preset scripting language plugin corresponding to a preset scripting language, and the device further includes:
[0233] The module is used to write the business logic of the application under test based on the above-mentioned preset scripting language, so as to obtain the target business logic;
[0234] The target business logic sending module is used to send the target business logic to the engine corresponding to the application under test, so that the engine sends the target business logic to the preset virtual machine corresponding to the preset scripting language.
[0235] Accordingly, the modules called include:
[0236] The first call result determination module is used to call the function from the preset virtual machine based on the preset scripting language plugin during the execution of the target business logic in the preset virtual machine, and obtain the function call result.
[0237] In an optional embodiment, the type of the function call result is a relational table type. Based on the aforementioned preset scripting language plugin, the apparatus further includes:
[0238] The conversion module is used to convert the type of the above function call result from the above relational table type to the string type, so as to obtain the converted function call result;
[0239] Accordingly, the call result sending module includes:
[0240] The converted function call result sending unit is used to send the converted function call result to the driver device, so that the driver device can parse the converted function call result to obtain the target function call result; and so that the test driver device can generate the second test result based on the target function call result.
[0241] In an optional embodiment, the above-mentioned calling module includes:
[0242] The second call result determination module is used to call the above function from the attribute system in the above engine and obtain the function call result.
[0243] In an optional embodiment, the above test information is obtained based on a data packet format protocol, and the above calling module includes:
[0244] The data packet information determination unit is used to parse the test information based on the above data packet format protocol to obtain the data packet information corresponding to the above data packet format protocol; the above data packet information includes multiple functions.
[0245] The function execution unit is used to execute the above functions and obtain the results of the function calls.
[0246] Figure 11 This is a block diagram illustrating another test result determination method based on an exemplary embodiment. (e.g.) Figure 11 As shown, the device may include at least:
[0247] The test information sending module 801 is used to execute a test script and send test information to the device under test (DUT). When the test information indicates that a test of the first interface operation is to be performed, the DUT obtains interface size adjustment information and interface position offset information corresponding to the current interface in the DUT. The operation complexity of the first interface operation is less than a preset complexity threshold. The DUT also determines the current position information of a target control based on the interface size adjustment information and the interface position offset information. The target control is the control required to perform the test of the first interface operation.
[0248] The current location information receiving module 803 is used to receive the current location information sent by the device under test;
[0249] The first test result generation module 805 is used to generate the first test result of the first interface operation based on the current location information mentioned above.
[0250] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0251] It should be noted that the device embodiments provided in this application are based on the same inventive concept as the method embodiments described above.
[0252] This application also provides an electronic device for determining test results. The electronic device includes a processor and a memory. The memory stores at least one instruction or at least one program. The processor loads and executes the at least one instruction or at least one program to implement the test result determination method provided in any of the above embodiments.
[0253] Embodiments of this application also provide a computer-readable storage medium that can be disposed in a terminal to store at least one instruction or at least one program related to implementing a test result determination method in the method embodiments. The at least one instruction or at least one program is loaded and executed by a processor to implement the test result determination method provided in the above method embodiments.
[0254] Optionally, in the embodiments of this specification, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0255] The memory described in this specification can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for functions, etc.; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0256] This application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the test result determination method provided in the above-described method embodiments.
[0257] The test result determination method provided in this application can be executed on a terminal, computer terminal, server, or similar computing device. Taking running on a server as an example... Figure 12 This is a hardware structure block diagram of a server determined according to test results, based on an exemplary embodiment. For example... Figure 12 As shown, the server 900 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 910 (CPUs 910 may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory 930 for storing data, and one or more storage media 920 (e.g., one or more mass storage devices) for storing application programs 923 or data 922. The memory 930 and storage media 920 may be temporary or persistent storage. The program stored in the storage media 920 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 910 may be configured to communicate with the storage media 920 and execute the series of instruction operations stored in the storage media 920 on the server 900. Server 900 may also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input / output interfaces 940, and / or one or more operating systems 921, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0258] The input / output interface 940 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 900. In one example, the input / output interface 940 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 940 may be a radio frequency (RF) module for wireless communication with the Internet.
[0259] Those skilled in the art will understand that Figure 12 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 900 may also include... Figure 12 The more or fewer components shown, or having the same Figure 12 The different configurations shown.
[0260] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0261] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and server embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0262] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware, or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0263] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for determining test results, characterized in that, The method includes: Receive test information sent by the driver device based on the test script; When the test information is used to indicate that the operation of the first interface is to be tested, the interface size adjustment information and interface position offset information corresponding to the current interface in the local device under test are obtained; the operation complexity of the first interface operation is less than a preset complexity threshold; the local device under test is equipped with an application under test, and the step of obtaining the interface position offset information corresponding to the current interface in the local device under test includes: obtaining the viewport size information of the engine corresponding to the application under test and the actual size information of the rendering window corresponding to the engine in the current interface; determining the interface size adjustment information based on the actual size information and the viewport size information; the step of obtaining the interface position offset information corresponding to the current interface in the local device under test includes: obtaining the interface layout information of the current interface; obtaining the first position information of the rendering window corresponding to the engine from the engine corresponding to the application under test; parsing the interface layout information to obtain the second position information of the rendering window in the current interface; determining the interface position offset information according to the first position information and the second position information; Based on the interface size adjustment information and the interface position offset information, the current position information of the target control is determined; the target control is the control required to perform the operation on the first interface. The current location information is sent to the driving device so that the driving device generates a first test result of the first interface operation based on the current location information.
2. The method for determining test results according to claim 1, characterized in that, Determining the current position information of the target control based on the interface size adjustment information and the interface position offset information includes: Based on the interface size adjustment information, the scaled position information of the controls in the engine corresponding to the application under test in the current interface is determined; the controls in the engine include the target control. The current position information is determined based on the scaled position information and the interface position offset information.
3. The method for determining test results according to claim 1, characterized in that, The local device under test is provided with a preset application programming interface. The step of obtaining the interface position offset information corresponding to the current interface in the local device under test further includes: Based on the preset application programming interface, the interface position offset information is obtained.
4. The method for determining test results according to any one of claims 1 to 3, characterized in that, The method further includes: When the test information indicates that the operation of the second interface is to be tested, the function in the engine corresponding to the application under test is called to obtain the function call result; the operation complexity of the second interface is greater than or equal to the preset complexity threshold. The function call result is sent to the driver device so that the driver device generates a second test result for the second interface operation based on the function call result.
5. The method for determining test results according to claim 4, characterized in that, The local device under test is equipped with a preset scripting language plugin corresponding to a preset scripting language. Before calling the function in the engine corresponding to the application under test and obtaining the function call result, the method further includes: The business logic of the application under test is written based on the preset scripting language to obtain the target business logic; The target business logic is sent to the engine corresponding to the application under test, so that the engine sends the target business logic to the preset virtual machine corresponding to the preset scripting language; The step of calling a function in the engine corresponding to the application under test and obtaining the function call result includes: During the execution of the target business logic in the preset virtual machine, the function is called from the preset virtual machine based on the preset scripting language plugin, and the function call result is obtained.
6. The method for determining test results according to claim 5, characterized in that, The function call result is of type relational table. After the function is called from the preset virtual machine based on the preset scripting language plugin to obtain the function call result, the method further includes: The type of the function call result is converted from the relational table type to a string type to obtain the converted function call result; The step of sending the function call result to the driver device, so that the driver device generates a second test result for the second interface operation based on the function call result, includes: The converted function call result is sent to the driver device, so that the driver device can parse the converted function call result to obtain the target function call result; and so that the driver device can generate the second test result based on the target function call result.
7. The method for determining test results according to claim 4, characterized in that, The step of calling a function in the engine corresponding to the application under test and obtaining the function call result includes: The function is called from the property system in the engine, and the result of the function call is obtained.
8. The method for determining test results according to claim 4, characterized in that, The test information is compiled based on a data packet format protocol. The function call result obtained by calling the function in the engine corresponding to the application under test includes: The test information is parsed based on the data packet format protocol to obtain data packet information corresponding to the data packet format protocol; the data packet information includes multiple functions. Execute the multiple functions to obtain the function call results.
9. A method for determining test results, characterized in that, The method includes: Execute the test script and send test information to the device under test (DUT); when the test information indicates that a first interface operation is to be tested, enable the DUT to obtain interface size adjustment information and interface position offset information corresponding to the current interface in the DUT; the operation complexity of the first interface operation is less than a preset complexity threshold; and enable the DUT to determine the current position information of the target control based on the interface size adjustment information and the interface position offset information; the target control is the control required to perform the operation for testing the first interface operation; the DUT has an application under test configured, and enabling the DUT to obtain the interface size adjustment information corresponding to the current interface in the DUT includes: enabling the DUT to obtain the interface size adjustment information corresponding to the current interface in the DUT. The device under test (DUT) is prepared to acquire viewport size information of the engine corresponding to the application under test and actual size information of the rendering window corresponding to the engine in the current interface. Based on the actual size information and the viewport size information, the interface size adjustment information is determined. The step of enabling the DUT to acquire interface position offset information corresponding to the current interface in the DUT includes: enabling the DUT to acquire interface layout information of the current interface, acquiring first position information of the rendering window corresponding to the engine from the engine corresponding to the application under test, parsing the interface layout information to obtain second position information of the rendering window in the current interface, and determining the interface position offset information based on the first position information and the second position information. Receive the current location information sent by the device under test; Based on the current location information, a first test result for the operation of the first interface is generated.
10. The method for determining test results according to claim 9, characterized in that, The step of generating a first test result for the first interface operation based on the current location information includes: Obtain the control file tree of the current interface from the engine corresponding to the application under test; the control file tree is used to represent the association between the attribute information and the position information of the control; Based on the current location information, the control file tree, and the attribute information of the target control, the target location information of the target control is determined; Based on the target location information, the device under test is controlled to test the target control to obtain the first test result.
11. The method for determining test results according to claim 9, characterized in that, The method further includes: When the test information is used to indicate that the operation of the second interface is to be tested, the function call result sent by the device under test is received; the function call result is obtained based on the device under test calling the function in the engine corresponding to the application under test, and the operation complexity of the second interface operation is greater than or equal to the preset complexity threshold. Based on the function call result, a second test result for the second interface operation is generated.
12. A test result determination device, characterized in that, The device includes: The test information receiving module is used to receive test information sent by the driver device based on the test script; An adjustment offset information acquisition module is used to acquire interface size adjustment information and interface position offset information corresponding to the current interface in the local device under test when the test information indicates that the operation of the first interface is to be tested; the operation complexity of the first interface operation is less than a preset complexity threshold; the local device under test is equipped with an application under test; the adjustment offset information acquisition module includes: a size information acquisition unit, used to acquire the viewport size information of the engine corresponding to the application under test and the actual size information of the rendering window corresponding to the engine in the current interface; an interface size adjustment information determination unit, used to determine the interface size adjustment information based on the actual size information and the viewport size information; an interface layout information acquisition unit, used to acquire the interface layout information of the current interface; a first position information acquisition unit, used to acquire the first position information of the rendering window corresponding to the engine from the engine corresponding to the application under test; a second position information acquisition unit, used to parse the interface layout information to obtain the second position information of the rendering window in the current interface; and an interface position offset information determination unit, used to determine the interface position offset information according to the first position information and the second position information. The current position information determination module is used to determine the current position information of the target control based on the interface size adjustment information and the interface position offset information; the target control is the control that needs to be operated to test the operation of the first interface. The current location information sending module is used to send the current location information to the driving device, so that the driving device generates a first test result of the first interface operation based on the current location information.
13. The test result determination device according to claim 12, characterized in that, The local device under test is equipped with an application under test. The current location information determination module includes: The scaling position information acquisition unit is used to determine the scaled position information of the control in the engine corresponding to the application under test in the current interface based on the interface size adjustment information; the control in the engine includes the target control; The current location information determination unit is used to determine the current location information based on the scaled location information and the interface location offset information.
14. The test result determination device according to claim 12, characterized in that, The local device under test is equipped with a preset application programming interface, and the offset information acquisition module further includes: The interface position offset information acquisition unit is used to acquire the interface position offset information based on the preset application programming interface.
15. The test result determination apparatus according to any one of claims 12 to 14, characterized in that, The device further includes: The calling module is used to call a function in the engine corresponding to the application under test when the test information indicates that the operation of the second interface is to be tested, and to obtain the function call result; the operation complexity of the second interface operation is greater than or equal to a preset complexity threshold. The function call result sending module is used to send the function call result to the driver device, so that the driver device can generate a second test result of the second interface operation based on the function call result.
16. The test result determination device according to claim 15, characterized in that, The local device under test is equipped with a preset script language plugin corresponding to a preset script language, and the device further includes: A writing module is used to write the business logic of the application under test based on the preset scripting language to obtain the target business logic; The target business logic sending module is used to send the target business logic to the engine corresponding to the application under test, so that the engine sends the target business logic to the preset virtual machine corresponding to the preset scripting language; The calling module includes: The first call result determination module is used to call the function from the preset virtual machine based on the preset scripting language plugin during the execution of the target business logic in the preset virtual machine, and obtain the function call result.
17. The test result determination device according to claim 16, characterized in that, The result of the function call is of type relational table, and the device further includes: The conversion module is used to convert the type of the function call result from the relational table type to the string type, so as to obtain the converted function call result; The call result sending module includes: The converted function call result sending unit is used to send the converted function call result to the driver device, so that the driver device can parse the converted function call result to obtain the target function call result; and so that the driver device can generate the second test result based on the target function call result.
18. The test result determination device according to claim 16, characterized in that, The calling module includes: The second call result determination module is used to call the function from the attribute system in the engine and obtain the function call result.
19. The test result determination device according to claim 16, characterized in that, The test information is obtained based on a data packet format protocol, and the calling module includes: A data packet information determination unit is used to parse the test information based on the data packet format protocol to obtain data packet information corresponding to the data packet format protocol; the data packet information includes multiple functions. The function execution unit is used to execute the multiple functions and obtain the function call results.
20. A test result determination device, characterized in that, The device includes: A test information sending module is used to execute a test script and send test information to the device under test (DUT). When the test information indicates that a first interface operation is to be tested, the DUT is configured to obtain interface size adjustment information and interface position offset information corresponding to the current interface in the DUT. The operation complexity of the first interface operation is less than a preset complexity threshold. The DUT is also configured to determine the current position information of a target control based on the interface size adjustment information and the interface position offset information. The target control is a control required to perform the operation on the first interface operation. The DUT contains an application under test. The step of enabling the DUT to obtain the interface size adjustment information corresponding to the current interface in the DUT includes: enabling... The device under test (DUT) acquires the viewport size information of the engine corresponding to the application under test and the actual size information of the rendering window corresponding to the engine in the current interface. Based on the actual size information and the viewport size information, it determines the interface size adjustment information. The step of enabling the DUT to acquire the interface position offset information corresponding to the current interface in the DUT includes: enabling the DUT to acquire the interface layout information of the current interface, acquiring the first position information of the rendering window corresponding to the engine from the engine corresponding to the application under test, parsing the interface layout information to obtain the second position information of the rendering window in the current interface, and determining the interface position offset information based on the first position information and the second position information. The current location information receiving module is used to receive the current location information sent by the device under test; The first test result generation module is used to generate a first test result for the first interface operation based on the current location information.
21. An electronic device for determining test results, the electronic device comprising a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the test result determination method as described in any one of claims 1 to 11.
22. A computer-readable storage medium storing at least one instruction or at least one program, said at least one instruction or said at least one program being loaded and executed by a processor to implement the test result determination method as claimed in any one of claims 1 to 11.
Citation Information
Patent Citations
Script recording method and apparatus
CN107193750A
User interface testing method and device
CN111881019A
