Method and device for generating vehicle-mounted instrument function test case script
Capture the on-board instrument display data through monitoring equipment and automatically generate test case scripts, solving the problems of low efficiency and poor accuracy of test case creation in the existing technology, and achieving efficient and accurate test script generation.
Patent Information
- Application Number
- CN202411954914.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-12-27
Smart Images

Figure CN119829455A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automotive electronic testing technology, and in particular to a method and device for generating a vehicle instrument function test case script. Background Art
[0002] With the development of the times, the use of cars is increasing, and every car is indispensable for the on-board instrument to display the car status. In order to ensure the correct indication of the instrument in actual use, a series of tests must be carried out in the instrument development stage, and the functional test is the most important. When conducting functional testing, the test script is the most important test basis.
[0003] Existing instruments have many functions. In order to ensure functional stability, a multi-person team is generally required to maintain and test the functions of the on-board instruments. The testing steps require each team member to manually write and create corresponding plain text test cases. This manual writing method not only reduces the efficiency of script creation, but also cannot guarantee the accuracy of the generated test scripts. Summary of the invention
[0004] In view of this, the purpose of the present application is to at least provide a method and device for generating a vehicle instrument function test case script, by integrating the display data of the vehicle instrument obtained by real-time monitoring to automatically create a case test script, thereby improving the efficiency of script creation while ensuring the timeliness and accuracy of script creation.
[0005] This application mainly includes the following aspects:
[0006] In a first aspect, an embodiment of the present application provides a method for generating a vehicle instrument function test case script, the method comprising: providing a function test project configuration interface for a target vehicle instrument, the function test project configuration interface comprising a project information configuration area and an instrument display area, the project information configuration area comprising an instrument data display sub-area; capturing a target display interface of the target vehicle instrument through a monitoring device and mapping it to the instrument display area, the instrument data display sub-area displaying multiple display attributes corresponding to the target display interface, the target display interface comprising multiple real-time display components, the display attributes describing an instrument display function; binding the display attributes to the corresponding real-time display components; for each display attribute, generating a corresponding use case test script according to the binding relationship between the display attribute and the corresponding real-time display component and the test template.
[0007] In a possible implementation, the project information configuration area also includes project basic information configuration items and instrument data loading controls, wherein the method also includes: in response to a selection operation performed on the instrument data loading control, loading a target instrument data packet corresponding to the target vehicle instrument from the target download address indicated by the project basic information through a CAN communication tool; parsing the target instrument data packet to obtain multiple interface display files corresponding to the target vehicle instrument, each interface display file corresponding to an instrument function interface provided by the target vehicle instrument, and each interface display file including multiple display attributes corresponding to the instrument function interface; determining a target instrument function interface corresponding to the target display interface; and loading multiple display attributes corresponding to the target instrument function interface into the instrument data display sub-area.
[0008] In a possible implementation, the step of binding a display attribute to its corresponding real-time display component includes: in response to a selection operation performed on a target display attribute, enabling a graphic capture function for a target display interface; in response to a capture operation performed on a target real-time display component corresponding to the target display attribute, binding the target real-time display component to the target display attribute.
[0009] In one possible implementation, a use case test script corresponding to each display attribute is generated in the following manner: in response to a test template creation trigger operation performed on a target display attribute, a test template configuration interface corresponding to the target display attribute is displayed, the test template configuration interface includes a first test step configuration entry, the first test step configuration entry includes a first test instruction configuration item and a test component configuration item; in response to a configuration operation performed on the first test instruction configuration item, first test instruction configuration data is generated; a configuration operation performed on the test component configuration item is received, a target real-time display component bound to the target display attribute is determined as a test object, and test object configuration data is generated; first test step configuration data corresponding to the first test step configuration entry is generated from the test object configuration data and the first test instruction configuration data; a test template corresponding to the target display attribute is formed from the first test step configuration data corresponding to each first test step configuration entry; in response to a test script generation operation performed on the test template, a use case test script corresponding to the test template is generated.
[0010] In a possible implementation, the test template configuration interface also includes a second test step configuration entry, the second test step configuration entry includes a second test instruction configuration item and an instruction parameter configuration item, wherein the method also includes: in response to the configuration operation performed on the second test instruction configuration item and the instruction parameter configuration item, generating second test step configuration data corresponding to the second test step configuration entry; generating a test template corresponding to the target display attribute from the first test step configuration data corresponding to each first test step configuration entry and the second test step configuration data corresponding to each second test step configuration entry and the step sequence between the test step configuration entries.
[0011] In one possible implementation, in response to a test script generation operation performed on a test template, the step of generating a use case test script corresponding to the test template includes: in response to a test script generation operation performed on the test template, generating a run statement corresponding to each test step configuration data according to the test step configuration data corresponding to each test step configuration entry; assembling multiple run statements according to the step sequence between the test step configuration entries to generate a use case test script corresponding to the test template.
[0012] In a possible implementation, the instrument display area also includes an instrument display interface adjustment option, wherein the method further includes: in response to a configuration operation performed on the instrument display interface adjustment option, adjusting the target display interface displayed in the instrument display area to a specified brightness and a specified size.
[0013] In the second aspect, an embodiment of the present application also provides a device for generating a vehicle-mounted instrument functional test case script, the device comprising: a providing module, used to provide a functional test project configuration interface for a target vehicle-mounted instrument, the functional test project configuration interface comprising a project information configuration area and an instrument display area, the project information configuration area comprising an instrument data display sub-area; a monitoring module, used to capture a target display interface of the target vehicle-mounted instrument through a monitoring device and map it to the instrument display area, the instrument data display sub-area displays multiple display attributes corresponding to the target display interface, and the target display interface comprises multiple real-time display components; a binding module, used to bind a display attribute to its corresponding real-time display component; a script generating module, used to generate a corresponding use case test script for each display attribute according to the binding relationship between the display attribute and its corresponding real-time display component and a test template.
[0014] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the method for generating a vehicle instrument function test case script in the above-mentioned first aspect or any possible implementation manner of the first aspect.
[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for generating a vehicle instrument function test case script in the above-mentioned first aspect or any possible implementation scheme of the first aspect are executed.
[0016] The embodiment of the present application provides a method and device for generating a case script for a vehicle instrument function test, including: capturing a target display interface of a target vehicle instrument through a monitoring device and mapping it to an instrument display area, wherein the instrument data display subarea displays multiple display attributes corresponding to the target display interface, wherein the target display interface includes multiple real-time display components, and the display attributes describe an instrument display function; binding the display attribute to its corresponding real-time display component; for each display attribute, generating a corresponding case test script according to the binding relationship between the display attribute and its corresponding real-time display component and a test template. By integrating the display data of the vehicle instrument obtained through real-time monitoring, the case test script is automatically created, thereby improving the efficiency of script creation while ensuring the timeliness and accuracy of script creation.
[0017] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A flow chart showing a method for generating a vehicle instrument function test case script provided by an embodiment of the present application;
[0020] Figure 2 A functional module diagram of a device for generating a vehicle instrument function test case script provided by an embodiment of the present application is shown;
[0021] Figure 3A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0022] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.
[0023] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0024] Existing instruments have many functions. In order to ensure functional stability, a multi-person team is generally required to maintain and test the functions of the on-board instruments. The testing steps require each team member to manually write and create corresponding plain text test cases. This manual writing method not only reduces the efficiency of script creation, but also cannot guarantee the accuracy of the generated test scripts.
[0025] Based on this, the embodiment of the present application provides a method and device for generating a vehicle instrument function test case script, which automatically creates a case test script by integrating the display data of the vehicle instrument obtained by real-time monitoring, thereby improving the efficiency of script creation while ensuring the timeliness and accuracy of script creation, as follows:
[0026] See also Figure 1 , Figure 1 The flowchart of a method for generating a vehicle instrument function test case script provided by an embodiment of the present application is shown. Figure 1 As shown, the method provided in the embodiment of the present application is integrated into a test case generation tool, and the test case generation tool is created based on the qt pydsigner display framework tool of python, and includes the following steps:
[0027] S100: providing a function test item configuration interface for a target vehicle instrument.
[0028] The functional test project configuration interface includes a project information configuration area and an instrument display area, and the project information configuration area includes an instrument data display sub-area.
[0029] S200: Capture a target display interface of a target vehicle-mounted instrument through a monitoring device and map it to an instrument display area.
[0030] The instrument data display sub-area displays a plurality of display attributes corresponding to the target display interface. The target display interface includes a plurality of real-time display components. The display attributes describe an instrument display function.
[0031] S300: Bind the display attribute to its corresponding real-time display component.
[0032] S400: For each display attribute, generate a corresponding use case test script according to the binding relationship between the display attribute and its corresponding real-time display component and the test template.
[0033] In step S100, the test case generation tool provides a functional test project creation interface for the vehicle instrument, the functional test project creation interface includes a functional test project creation control, and in response to a selection operation performed on the functional test project creation control, a functional test project configuration interface is displayed, the functional test project configuration interface includes a project information configuration area and an instrument display area.
[0034] The project information configuration area includes project basic information configuration items, monitoring equipment configuration items and instrument data loading controls.
[0035] In a preferred embodiment, the project basic information configuration item is used to configure the project basic information corresponding to the created functional test project. The project basic information includes but is not limited to at least one of the following items: the project name, the vehicle model information corresponding to the target vehicle instrument, and the target download address corresponding to the instrument data packet provided by the manufacturer of the target vehicle instrument. Specifically, the project basic information configuration item includes the project name configuration item, the vehicle model configuration item to which the target vehicle instrument belongs, and the service configuration item. In response to the configuration operations performed on the project name configuration item, the vehicle model configuration item to which the target vehicle instrument belongs, and the service configuration item, the project name, the vehicle model information corresponding to the target vehicle instrument, and the target download address are generated. In this application, based on the different designs of vehicle instruments by different manufacturers, after the target vehicle instrument to be tested is clearly identified, it is necessary to obtain the corresponding instrument data packet based on the manufacturer to which the target vehicle instrument belongs to generate subsequent test scripts. Specifically, the target download address can be the data interface address provided by the manufacturer to which the target vehicle instrument belongs.
[0036] In a preferred embodiment, the monitoring device configuration items include at least a monitoring device refresh control, a monitoring device disconnect control and a monitoring device connection control. In the present application, the monitoring device may be a high-resolution industrial camera. The monitoring device is arranged on a test bench near the target vehicle instrument to capture the target display interface displayed in real time by the target vehicle instrument. The on-off control of the monitoring device may be implemented by the monitoring device configuration items. Specifically, in response to a selection operation performed on the monitoring device disconnect control, the connection between the test case generation tool carried by the host computer and the monitoring device is cut off. In response to a selection operation performed on the monitoring device connection control, the connection between the test case generation tool carried by the host computer and the monitoring device is connected. In response to a selection operation performed on the monitoring device refresh control, the connection communication between the monitoring device and the test case generation tool is refreshed.
[0037] In a preferred embodiment, step S200 includes:
[0038] In response to the selection operation performed on the monitoring device connection control, the test case generation tool carried by the host computer is connected to the monitoring device, and the target display interface of the target vehicle instrument captured by the monitoring device is displayed in the instrument display area.
[0039] In a preferred embodiment, the method provided by the present application further includes:
[0040] In response to a selection operation performed on an instrument data loading control, a target instrument data packet corresponding to a target on-board instrument is loaded from a target download address through a CAN communication tool, the target instrument data packet is parsed, and a plurality of interface display files corresponding to the target on-board instrument are obtained, each interface display file corresponds to an instrument function interface provided by the target on-board instrument, each interface display file includes a plurality of display attributes corresponding to the instrument function interface, a target instrument function interface corresponding to the target display interface is determined, and the plurality of display attributes corresponding to the target instrument function interface are loaded into the instrument data display sub-area.
[0041] Specifically, in the present application, based on the target display interface actually collected by the monitoring device, multiple display attributes corresponding to it are dynamically loaded, so that the test script creator can be freed from the large number of display attributes corresponding to the target vehicle instrument, so that he only focuses on the creation of relevant test scripts corresponding to the target display interface currently corresponding to the target vehicle instrument, and the created test script is invalid.
[0042] Preferably, the display attribute actually corresponds to an instrument display function provided by a manufacturer of a target vehicle instrument, such as a hill descent indicator light, a power mode, a vehicle speed setting, and an engine speed setting, and each instrument display function is associated with a corresponding function operation code.
[0043] In a preferred embodiment, step S300 includes:
[0044] In response to a selection operation performed on a target display attribute, a graphic capture function for a target display interface is enabled, and in response to a capture operation performed on a target real-time display component corresponding to the target display attribute, the target real-time display component is bound to the target display attribute.
[0045] In the specific implementation, taking the target display attribute as the engine speed setting as an example, the engine speed setting is selected to trigger the graphic capture function of the target display interface. At this time, the user can capture the target real-time display component corresponding to the engine speed from the target display interface, and bind the target real-time display component to the engine speed setting. The purpose of this process is that the original display component corresponding to the engine speed setting may not match the component displayed by the target vehicle instrument. In this application, by establishing the corresponding binding, the real-time display data of the target vehicle instrument is always used as the basis, which can ensure the timeliness and accuracy of the subsequent use case test script creation and the test script running process.
[0046] In another preferred embodiment, the instrument display area also includes a re-capture option, a save screenshot option, a abandon capture option and a select save directory option, wherein, in response to a selection operation performed on the re-capture option, the capture operation can be re-triggered, in response to a selection operation performed on the abandon capture option, the current capture operation can be abandoned, and in response to a configuration operation performed on the select save directory option, the save location of the current captured image is determined.
[0047] In a preferred embodiment, the instrument display area also includes an instrument display interface adjustment option, wherein the method further includes:
[0048] In response to the configuration operation performed on the instrument display interface adjustment option, the target display interface displayed in the instrument display area is adjusted to a specified brightness and a specified size.
[0049] Specifically, the instrument display area also includes multiple instrument display adjustment configuration items, and the multiple instrument display adjustment configuration items include at least brightness adjustment configuration items, size adjustment configuration items and adjustment configuration confirmation controls. In response to configuration operations performed on the brightness adjustment configuration items and the size adjustment configuration items, respectively, the target display interface displayed in the instrument display area is adjusted to a specified brightness and a specified size. In response to a selection operation performed on the adjustment configuration confirmation control, the adjustment configuration data determined by the configuration of the multiple instrument display adjustment configuration items is saved, and the target display interface is redisplayed according to the adjustment configuration data.
[0050] In a preferred embodiment, step S400 includes:
[0051] In response to a test template creation trigger operation performed on a target display attribute, a test template configuration interface corresponding to the target display attribute is displayed, the test template configuration interface includes a first test step configuration entry, each test step configuration entry corresponds to a test step, the first test step configuration entry includes a first test instruction configuration item and a test component configuration item, in response to a configuration operation performed on the first test instruction configuration item, first test instruction configuration data is generated, a configuration operation performed on the test component configuration item is received, a target real-time display component bound to the target display attribute is determined as a test object, and test object configuration data is generated, first test step configuration data corresponding to the first test step configuration entry is generated from the test object configuration data and the first test instruction configuration data, a test template corresponding to the target display attribute is formed from the first test step configuration data corresponding to each first test step configuration entry, in response to a test script generation operation performed on the test template, a use case test script corresponding to the test template is generated.
[0052] In another preferred embodiment, the test template configuration interface further includes a second test step configuration entry, the second test step configuration entry includes a second test instruction configuration item and an instruction parameter configuration item, wherein the method further includes:
[0053] In response to the configuration operation performed on the second test instruction configuration item and the instruction parameter configuration item, second test step configuration data corresponding to the second test step configuration entry is generated, and a test template corresponding to the target display attribute is generated based on the first test step configuration data corresponding to each first test step configuration entry, the second test step configuration data corresponding to each second test step configuration entry, and the step sequence between the test step configuration entries.
[0054] Specifically, since the display attributes of the present application actually correspond to a display function of a vehicle-mounted instrument, building a use case test script for the display attributes is actually a display test of the display attributes based on actual needs, mainly testing whether it can be displayed normally or whether the display status meets the requirements under the test conditions indicated by the use case test script. In the present application, in response to a test template creation trigger operation executed for the target display attributes, a test template configuration interface can be displayed. In the present application, multiple test step configuration entries can be created and added in advance in the test template configuration interface.
[0055] Specifically, the present application provides a test step configuration component for creating a test step configuration entry. The corresponding test step configuration components are selected according to the requirements and combined to form a corresponding test step configuration entry. Generally, the test step configuration entry in the present application is divided into a first test step configuration entry including a test object and a second test step configuration entry not including a test object. The first test step configuration entry is actually used to configure related step configuration data with the target display attribute as the execution object, and the second test step configuration entry is actually a restriction condition on the first test step configuration entry.
[0056] After completing the creation of the test step configuration entry, you can configure and generate a use case test script corresponding to the target display attribute based on the created test step configuration entry. Specifically, the first test step configuration entry includes a first test instruction configuration item and a test component configuration item.
[0057] In a specific embodiment, assuming that the target display attribute is "transmission fault alarm indication", the first test instruction configuration item is used to configure the trigger signal for the "transmission fault alarm indication", and the test component configuration item is used to configure the test object, which is the "transmission fault alarm indication" in this example. Then, the corresponding first test step configuration data is formed by the "transmission fault alarm indication" and its corresponding trigger signal.
[0058] In another specific embodiment, assuming that the target display attribute is "transmission fault alarm indication", and the corresponding first test step configuration data is formed by the "transmission fault alarm indication" and its corresponding trigger signal, then the corresponding second test step configuration entry, the corresponding second test instruction configuration item can be configured as a pause time, and the instruction parameter configuration item can be configured as 3000, thereby forming the second test step configuration data corresponding to the above-mentioned first test step configuration data.
[0059] In this way, further, by combining the first test step configuration data and the second test step configuration data, a test template corresponding to the target display attribute can be generated.
[0060] In a preferred embodiment, in response to a test script generation operation performed on a test template, the step of generating a use case test script corresponding to the test template includes:
[0061] In response to the test script generation operation performed on the test template, an execution statement corresponding to each test step configuration data is generated according to the test step configuration data corresponding to each test step configuration entry, and multiple execution statements are assembled according to the step sequence between the test step configuration entries to generate a use case test script corresponding to the test template.
[0062] In the present application, after each test step configuration entry is created, according to the subsequent configuration of each configuration item in the test step configuration entry, its corresponding configuration data is actually pre-mapped to the corresponding underlying running code. For example, taking the first test instruction configuration item and the test component configuration item corresponding to the first test step configuration entry as an example, assuming that the target display attribute is "transmission fault alarm indication", the first test instruction configuration item is configured as a trigger signal for the "transmission fault alarm indication", and the test component configuration item is configured as "transmission fault alarm indication", then, in fact, combined with this first test step configuration item and its corresponding first test step configuration data, its corresponding test logic is parsed as "generate a signal that triggers a transmission fault alarm indication", then according to this test logic, from the underlying logic running file corresponding to the "transmission fault alarm indication", this part of the underlying running code is extracted and the corresponding running statement is formed.
[0063] Furthermore, based on the step sequence and logical relationship between different test step configuration items, the running statements are assembled to automatically form the corresponding use case test script.
[0064] In another preferred embodiment, the generated use case test script corresponding to the target vehicle-mounted device is saved in a designated folder corresponding to the target vehicle-mounted device, and is further classified into the display attributes corresponding to the designated folder according to the test object (display attributes) corresponding to the use case test script, which is more convenient for viewing.
[0065] In a preferred embodiment, since the present application provides a method of capturing the display interface of the target vehicle-mounted instrument through a monitoring device, the present application can also monitor the instrument changes of the target vehicle-mounted instrument by displaying the display interface of the target vehicle-mounted instrument in real time, and can automatically respond as soon as a problem with the target vehicle-mounted instrument is detected. Based on the captured display interface, the display status of the display interface of the target vehicle-mounted device can be automatically judged according to the normal display status of the display interface, such as normal operation, warning or failure, which significantly reduces the time for problem diagnosis and processing.
[0066] Moreover, all use case test scripts are built based on the binding relationship between display properties and real-time display components, which greatly reduces the tedious problem of manual test case writing due to instrument changes, and realizes the function of automatic identification and automatic creation of use case scripts.
[0067] Based on the same application concept, the embodiment of the present application also provides a device for generating a vehicle instrument function test case script corresponding to the method for generating a vehicle instrument function test case script provided in the above embodiment. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the method for generating a vehicle instrument function test case script in the above embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0068] See also Figure 2 , Figure 2 The functional module diagram of a device for generating a vehicle instrument function test case script provided by an embodiment of the present application is shown. Figure 2 As shown, the device comprises:
[0069] Providing a module 500, for providing a function test project configuration interface for a target vehicle instrument, the function test project configuration interface comprising a project information configuration area and an instrument display area, the project information configuration area comprising an instrument data display sub-area;
[0070] Monitoring module 510, used to capture the target display interface of the target vehicle instrument through the monitoring device and map it to the instrument display area, the instrument data display sub-area displays multiple display attributes corresponding to the target display interface, and the target display interface includes multiple real-time display components;
[0071] A binding module 520, used to bind the display attribute with its corresponding real-time display component;
[0072] The script generation module 530 is used to generate a corresponding use case test script for each display attribute according to the binding relationship between the display attribute and its corresponding real-time display component and the test template.
[0073] Based on the same application idea, please refer to Figure 3 , Figure 3 FIG. 1 is a schematic diagram showing the structure of an electronic device provided by an embodiment of the present application. Figure 3 As shown, the electronic device 600 includes: a processor 610, a memory 620 and a bus 630. The memory 620 stores machine-readable instructions executable by the processor 610. When the electronic device 600 is running, the processor 610 and the memory 620 communicate through the bus 630. The machine-readable instructions are executed by the processor 610 when it is running, such as the steps of the method for generating a vehicle instrument function test case script provided in any of the above embodiments.
[0074] Based on the same application concept, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for generating a vehicle instrument function test case script provided in the above embodiment are executed.
[0075] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0076] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0077] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0078] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0079] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for generating a vehicle instrument function test case script, characterized in that: The method comprises: Provide a function test item configuration interface for a target vehicle instrument, the function test item configuration interface comprising a project information configuration area and an instrument display area, the project information configuration area comprising an instrument data display sub-area; The target display interface of the target vehicle instrument is captured by a monitoring device and mapped to the instrument display area, the instrument data display subarea displays a plurality of display attributes corresponding to the target display interface, the target display interface includes a plurality of real-time display components, and the display attributes describe an instrument display function; Bind display properties to their corresponding real-time display components; For each display attribute, a corresponding use case test script is generated according to the binding relationship between the display attribute and its corresponding real-time display component and the test template.
2. The method according to claim 1, characterized in that The project information configuration area also includes project basic information configuration items and instrument data loading controls. Wherein, the method further comprises: In response to the selection operation performed on the instrument data loading control, a target instrument data packet corresponding to the target on-board instrument is loaded from the target download address indicated by the project basic information through a CAN communication tool; Parsing the target instrument data packet to obtain a plurality of interface display files corresponding to the target vehicle instrument, each interface display file corresponding to an instrument function interface provided by the target vehicle instrument, and each interface display file including a plurality of display attributes corresponding to the instrument function interface; Determining a target instrument function interface corresponding to the target display interface; Loading a plurality of display attributes corresponding to the target instrument function interface into the instrument data display sub-area.
3. The method according to claim 1, characterized in that The steps of binding a display property to its corresponding real-time display component include: In response to a selection operation performed on a target display attribute, enabling a graphic capture function for the target display interface; In response to an interception operation performed on a target real-time display component corresponding to a target display attribute, the target real-time display component is bound to the target display attribute.
4. The method according to claim 1, characterized in that: Generate a test script for each display attribute in the following way: In response to a test template creation trigger operation executed for a target display attribute, a test template configuration interface corresponding to the target display attribute is displayed, the test template configuration interface including a first test step configuration entry, the first test step configuration entry including a first test instruction configuration item and a test component configuration item, generating first test instruction configuration data in response to a configuration operation performed on the first test instruction configuration item; receiving a configuration operation performed on a test component configuration item, determining a target real-time display component bound to a target display attribute as a test object, and generating test object configuration data; Generate first test step configuration data corresponding to a first test step configuration entry from the test object configuration data and the first test instruction configuration data; Forming a test template corresponding to the target display attribute from the first test step configuration data corresponding to each first test step configuration entry; In response to a test script generation operation performed on a test template, a use case test script corresponding to the test template is generated.
5. The method according to claim 4, characterized in that The test template configuration interface also includes a second test step configuration entry, wherein the second test step configuration entry includes a second test instruction configuration item and an instruction parameter configuration item. Wherein, the method further comprises: In response to the configuration operation performed on the second test instruction configuration item and the instruction parameter configuration item, generating second test step configuration data corresponding to the second test step configuration entry; A test template corresponding to the target display attribute is generated based on the first test step configuration data corresponding to each first test step configuration entry, the second test step configuration data corresponding to each second test step configuration entry, and the step sequence between the test step configuration entries.
6. The method according to claim 5, characterized in that In response to the test script generation operation performed on the test template, the step of generating a use case test script corresponding to the test template includes: In response to a test script generation operation executed on the test template, generating a run statement corresponding to each test step configuration data according to the test step configuration data corresponding to each test step configuration entry; Multiple run statements are assembled according to the step sequence between the test step configuration items to generate a use case test script corresponding to the test template.
7. The method according to claim 1, characterized in that The instrument display area also includes instrument display interface adjustment options. Wherein, the method further comprises: In response to the configuration operation performed on the instrument display interface adjustment option, the target display interface displayed in the instrument display area is adjusted to a specified brightness and a specified size.
8. A device for generating a vehicle instrument function test case script, characterized in that: The device comprises: Providing a module for providing a function test item configuration interface for a target vehicle instrument, the function test item configuration interface comprising a project information configuration area and an instrument display area, the project information configuration area comprising an instrument data display sub-area; A monitoring module, used for capturing the target display interface of the target vehicle-mounted instrument through a monitoring device and mapping it to the instrument display area, the instrument data display subarea displays a plurality of display attributes corresponding to the target display interface, and the target display interface includes a plurality of real-time display components; A binding module, used to bind display attributes to their corresponding real-time display components; The script generation module is used to generate a corresponding use case test script for each display attribute according to the binding relationship between the display attribute and its corresponding real-time display component and the test template.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor when running to execute the steps of the method for generating a vehicle instrument function test case script as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for generating a vehicle instrument function test case script as described in any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Method and device for generating test case script
CN107122295A
Method and device for generating test script
CN113626301A
Test case generation method and system based on automobile instrument test
CN113971126A
Methods and systems for implementing a test automation framework for testing software applications on UNIX / linux based machines
US20100100872A1
Cited By
Instrument detection system and method
CN121209745A
Instrument detection system and method
CN121209745B