CN118069541B - Test button generation method, device, equipment, medium and product - Google Patents

Test button generation method, device, equipment, medium and product Download PDF

Info

Publication number
CN118069541B
CN118069541B CN202410494600.1A CN202410494600A CN118069541B CN 118069541 B CN118069541 B CN 118069541B CN 202410494600 A CN202410494600 A CN 202410494600A CN 118069541 B CN118069541 B CN 118069541B
Authority
CN
China
Prior art keywords
test
file
button
source file
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410494600.1A
Other languages
Chinese (zh)
Other versions
CN118069541A (en
Inventor
曾旋
焦健
黄建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Wanliyan Technology Co ltd
Original Assignee
Shenzhen Wanliyan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Wanliyan Technology Co ltd filed Critical Shenzhen Wanliyan Technology Co ltd
Priority to CN202410494600.1A priority Critical patent/CN118069541B/en
Publication of CN118069541A publication Critical patent/CN118069541A/en
Application granted granted Critical
Publication of CN118069541B publication Critical patent/CN118069541B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a test button generation method, a device, equipment, a medium and a product, which can be used in the technical field of data processing. In the method, after the name of a target button and test operation data input by a user are acquired, analyzing the test operation data to generate a target test file; further, a target menu identifier which does not have a corresponding relation in a preset menu identifier list is established with a corresponding relation between the target button name and a target test file; and finally, generating a test button according to the corresponding relation. According to the scheme, the test button can be generated by acquiring the name of the target button and the test operation data input by the user, so that the generation efficiency is effectively improved.

Description

Test button generation method, device, equipment, medium and product
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, a medium, and a product for generating a test button.
Background
With the development of technology, various test devices are developed, and the test devices can run according to test instructions to complete the test process. Test software is installed in the test equipment, the test software can provide some test functions, a user clicks a button corresponding to the test functions, and the test equipment operates after acquiring corresponding test instructions. However, some complex tests require multiple test functions or multiple test instructions to complete, and in order to improve the test efficiency, a custom test button may be generated, so that a user clicks the button to implement the complex test.
In the prior art, for generating a test button, a Macro Recorder (Macro Recorder) function is generally required, and after the Macro Recorder is started, the user operation is recorded, and after the recording is completed, the test button is formed. After the user clicks the button, the test equipment repeats the operation of the user to complete the test.
However, this test button generation method requires the user to perform a complete one-time test procedure, resulting in a low efficiency of generating test buttons.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment, a medium and a product for generating a test button, which are used for improving the efficiency of generating the test button.
In a first aspect, an embodiment of the present application provides a test button generating method, applied to a test device, where the method includes:
responding to the newly added test button operation of the user, and acquiring the name of the target button and test operation data input by the user;
analyzing the test operation data to generate a target test file;
Selecting a target menu identifier which has no corresponding relation with the existing button name and the test file from a preset menu identifier list;
Establishing a corresponding relation among the target button name, the target test file and the target menu identifier;
And responding to the confirmation generating operation of the user, and generating a test button according to the corresponding relation.
By adopting the technical scheme provided by the application, the test button can be generated by acquiring the name of the target button and the test operation data input by the user, so that the generation flow is simplified, the generation time is shortened, and the generation efficiency is effectively improved. In addition, by selecting different target button names and test operation data, the generated test button not only can realize the combined function of the original buttons of the test equipment, but also can realize functions other than the combined function of the original buttons, and has strong adaptability and expandability.
In one embodiment, the test operation data includes a test source file, and/or an operation instruction; analyzing the test operation data to generate a target test file, including:
judging whether the test operation data comprises a test source file or not, and generating a judging result;
And analyzing the test operation data according to the judging result to generate the target test file.
By adopting the technical scheme provided by the application, the test operation data are analyzed in different analysis modes according to the judging result of whether the test operation data comprise the test source file, so that the test file can be generated by different test operation data, and the compatibility is improved.
In a specific embodiment, the analyzing the test operation data according to the determination result to generate the target test file includes:
If the judging result indicates that the test operation data comprises a test source file, analyzing the test source file according to the file type of the test source file for each test source file included in the test operation data to obtain an operation instruction subset corresponding to the test source file;
Generating an operation instruction set according to whether the test operation data comprises a test instruction and an operation instruction subset corresponding to each test source file;
and processing the operation instruction set to generate an extensible markup language file to obtain the target test file.
By adopting the technical scheme provided by the application, when the test operation data comprises the test source file, the test source file is analyzed to obtain the operation instruction subset, and then the operation instruction set is generated by combining whether the test operation data comprises the test instruction or not, so that the test file generated according to the operation instruction set can more accurately reflect the operation of the test equipment.
In a specific embodiment, the generating an operation instruction set according to whether the test operation data includes a test instruction and an operation instruction subset corresponding to each test source file includes:
if the test operation data comprises test instructions, sequencing the operation instructions in the operation instruction subset corresponding to each test source file and the operation instructions in the test operation data according to the sequence of the test source file and the operation instructions in the test operation data to obtain an operation instruction set;
And if the test operation data does not comprise the test instruction, sequencing the operation instructions in the operation instruction subset corresponding to each test source file according to the sequence of the test source files in the test operation data to obtain the operation instruction set.
By adopting the technical scheme provided by the application, the operation instruction set is generated according to whether the test operation data comprises the test instruction or not, so that the operation instruction in the operation instruction set is more accurate.
In a specific embodiment, according to a file type of the test source file, analyzing the test source file to obtain an operation instruction subset corresponding to the test source file, including:
If the file type of the test source file is an executable file, displaying a plurality of test protocols included in the test source file;
responding to the protocol selection operation of the user, and acquiring a target test protocol selected by the user from the plurality of test protocols;
judging whether the version of the target test protocol belongs to a preset version range or not;
if the version of the target test protocol belongs to a preset version range, analyzing the target test protocol to obtain an operation instruction subset corresponding to the test source file;
And if the version of the target test protocol does not belong to the preset version range, setting the operation instruction subset corresponding to the test source file as an empty set.
By adopting the technical scheme provided by the application, when the file type of the test source file is an executable file, whether a target test protocol selected from a plurality of test protocols included in the test source file is available or not is judged, and when the target test protocol is available, an operation instruction set is obtained by analysis; when the target test protocol is unavailable, the operation instruction subset is set as an empty set, so that the operation instruction subset can be generated certainly, and the situation that the test button cannot be generated due to the lack of the operation instruction subset is avoided.
In a specific embodiment, according to a file type of the test source file, analyzing the test source file to obtain an operation instruction subset corresponding to the test source file, including:
If the file type of the test source file is a programmable instrument standard command script file, judging whether each operation instruction in the test source file is a writable write command or not;
if the operation instruction is a writable write instruction, acquiring a linkage instruction corresponding to the operation instruction;
And adding linkage instructions corresponding to the operation instructions after the operation instructions for each operation instruction which is a writable writing command in the test source file to obtain an operation instruction subset corresponding to the test source file.
By adopting the technical scheme provided by the application, when the file type of the test source file is the standard command script file of the programmable instrument, the linkage instruction is combined to generate the operation instruction subset, so that the integrity of the operation instruction subset is ensured.
In a specific embodiment, the analyzing the test operation data according to the determination result to generate the target test file includes:
If the judging result indicates that the test operation data does not comprise the test source file, judging whether the instruction name of each operation instruction in the test operation data belongs to a preset instruction name set or not;
if the instruction name of the operation instruction does not belong to a preset instruction name set, deleting the operation instruction from the test operation data to obtain updated test operation data;
And generating an extensible markup language file for processing the updated test operation data to obtain the target test file.
By adopting the technical scheme provided by the application, when the test operation data does not comprise the test source file, each operation instruction in the test operation data is checked, so that the test file is generated, the accuracy of the test file is higher, and the safety of the test equipment for executing the test file is higher.
In one embodiment, the method further comprises:
if the test execution parameters input by the user are acquired, establishing a corresponding relation between the target button name and the test execution parameters;
if the test execution parameters input by the user are not acquired, establishing a corresponding relation between the target button name and the preset test execution parameters.
By adopting the technical scheme provided by the application, the corresponding relation is established between the button name and the preset test execution parameters, so that the test equipment can test according to the test execution parameters input by a user during testing, the test accuracy is improved, and the test flexibility is also improved.
In one embodiment, the method further comprises:
responding to the operation of clicking a test button by a user, and acquiring the button name of the test button;
acquiring a test file corresponding to the button name and a test execution parameter corresponding to the button name;
performing deserialization operation on the test file to obtain an operation instruction set;
And executing the operation instruction set according to the test execution parameters.
By adopting the technical scheme provided by the application, the test file and the test execution parameters are determined according to the corresponding relation among the button name, the menu identifier and the test file and the corresponding relation between the button name and the test execution parameters, and then the test file is subjected to deserialization operation, so that an operation instruction set is obtained, and then the operation instruction set is executed according to the test execution parameters, thereby realizing one-key test and improving the test efficiency. In addition, the test button is decoupled from the test operation data after being generated, and the test operation data input by a user is not needed in the test, so that the test button and the test process are not changed when the test operation data are changed.
In a second aspect, an embodiment of the present application provides a test button generating device configured to perform the test button generating method according to any one of the first aspects. The technical effects achieved by the device are referred to above in the first aspect and will not be described in detail.
In one embodiment, the test button generating device includes:
the acquisition module is used for responding to the newly added test button operation of the user and acquiring the name of the target button and the test operation data input by the user;
A processing module for:
analyzing the test operation data to generate a target test file;
Selecting a target menu identifier which has no corresponding relation with the existing button name and the test file from a preset menu identifier list;
Establishing a corresponding relation among the target button name, the target test file and the target menu identifier;
And the generating module is used for responding to the confirmation generating operation of the user and generating a test button according to the corresponding relation.
In a third aspect, an embodiment of the present application provides a test apparatus, including:
A processor, a memory, a communication interface;
The memory is used for storing executable instructions of the processor;
Wherein the processor is configured to perform the test button generation method of any of the first aspects via execution of the executable instructions.
In a fourth aspect, an embodiment of the present application provides a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the test button generation method according to any one of the first aspects.
In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computer program for implementing the test button generation method according to any one of the first aspects when the computer program is executed by a processor.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions of the prior art, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it will be obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a schematic diagram of an interface of an original button of a test device according to the present application;
FIG. 2 is a flowchart of a first embodiment of a method for generating test buttons according to the present application;
FIG. 3 is a schematic diagram of an edit customization menu interface provided by the present application;
FIG. 4 is a schematic diagram of a selection input mode interface provided by the present application;
FIG. 5 is a schematic diagram of a loading file interface provided by the present application;
FIG. 6 is a schematic diagram of an input command interface provided by the present application;
FIG. 7 is a schematic diagram of a custom menu provided by the present application;
FIG. 8 is a schematic flow chart of a second embodiment of a test button generation method according to the present application;
FIG. 9 is a schematic flow chart of a third embodiment of a test button generation method provided by the present application;
FIG. 10 is a flowchart of a fourth embodiment of a test button generation method according to the present application;
FIG. 11 is a flowchart of a fifth embodiment of a test button generation method provided by the present application;
FIG. 12 is a schematic diagram of the correspondence provided by the present application;
FIG. 13 is a flowchart of a sixth embodiment of a method for generating test buttons according to the present application;
FIG. 14 is a schematic diagram of an embodiment of a test button generating device according to the present application;
Fig. 15 is a schematic structural diagram of a test apparatus according to the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which are made by a person skilled in the art based on the embodiments of the application in light of the present disclosure, are intended to be within the scope of the application.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For example, fig. 1 is a schematic diagram of a test function interface of a test device provided by the present application, as shown in fig. 1, in which there are 24 buttons corresponding to test functions, in a complex test, function 1, function 3, function 4, function 5, function 12, function 20, function 15, function 23, and function 10 need to be tested sequentially, and a user may start macro recording, and then click the buttons corresponding to function 1, function 3, function 4, function 5, function 12, function 20, function 15, function 23, and function 10 sequentially according to execution duration corresponding to each function. The test equipment records the operation of the user, and a test button is formed after the recording is completed. After the user clicks the test button, the test equipment repeats the operation of the user to complete the test. This approach requires the user to perform a test procedure, resulting in less efficient generation of test buttons. In addition, if the function of the original button of the test device cannot realize the test, the user cannot use the original button to realize the test, and the test device cannot generate the test button. And after the test equipment is restarted, the test equipment still needs to be re-recorded, and the operation is complex.
Yet another method may generate test buttons, and the user selects the desired test function, and the test equipment is then combined to form a test button. For example, based on the above example, the user selects the button corresponding to the test button, and then clicks the buttons corresponding to the functions 1,3, 4, 5, 12, 20, 15, 23 and 10 in turn, and after clicking the generated button, the test device combines the functions according to the clicking order to generate one test button. In addition, when the original button function of the testing device cannot realize testing, the user cannot use the original button to realize testing, and the testing device cannot generate the testing button.
In order to solve the technical problems of low efficiency and complex operation of generating test buttons, the application provides a test button generation scheme, wherein only a user is required to input a button name and test operation data, test equipment generates a test file according to the test operation data and selects a menu identifier, then establishes a corresponding relation among the button name, the test file and the menu identifier, and finally generates the test button according to the corresponding relation, so that a user does not need to perform a complete test process, and the purpose of efficiently generating the test button is achieved.
The application scenario of the test button generation method provided by the application is illustrated below.
In the application scenario, for example, a user needs to use a testing device to perform a complex test on products, and because of the large number of products, in order to improve the testing efficiency, a testing button needs to be generated to implement one-key testing on the products.
And the user performs newly-added test button operation on the test equipment, and inputs the name of the target button, test operation data and test execution parameters. The test device may acquire these data input by the user in response to the user's operation.
The test equipment analyzes the test operation data to generate a target test file; the target test file is generated according to the operation instruction obtained through analysis.
And selecting a target menu identifier which does not have a corresponding relation with the existing button name and test file from a preset menu identifier list, establishing a corresponding relation among the target button name, the target test file and the target menu identifier, and establishing a corresponding relation between the target button name and test execution parameters.
At this time, the test device may display an interface for confirming whether the user confirms, the user may perform a confirmation operation, and the test device generates a test button according to the established correspondence in response to the confirmation generation operation of the user. I.e. the target button name is displayed on the test button. The generated test button is a custom test button.
And then the user can click the test button, the test equipment can acquire the button name, and then the test file and the test execution parameter corresponding to the button name can be determined, and further the test file is subjected to deserialization operation, and after an operation instruction set is obtained, the test is carried out according to the test execution parameter and the operation instruction set, so that the test of the product is realized.
It should be noted that the test device may be a digital oscilloscope, a spectrum analyzer, a logic analyzer, etc., and the embodiment of the present application does not limit the test device, and may be determined according to the actual situation.
It should be noted that the above scenario is only an example of an application scenario provided by the embodiment of the present application, and the embodiment of the present application does not limit the actual forms of various devices included in the scenario, and may be set according to actual requirements in a specific application of the scheme.
The technical scheme of the application is described in detail through specific embodiments. It should be noted that the following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
Fig. 2 is a schematic flow chart of an embodiment of a test button generating method provided by the present application, and the embodiment of the present application describes a case that a test device generates a test button according to a target button name and test operation data input by a user. The method in this embodiment may be implemented by software, hardware, or a combination of software and hardware. As shown in fig. 2, the test button generation method specifically includes the following steps:
s201: and responding to the newly added test button operation of the user, and acquiring the target button name and test operation data input by the user.
In the step, when a test button needs to be generated, a user performs a new test button operation on the test equipment, and the test equipment responds to the new test button operation of the user to acquire a target button name and test operation data input by the user.
Specifically, the test device may display a function interface, the function interface has an edit custom menu button, the custom menu includes a test button, the user may click the edit custom menu button, and the test device displays the edit custom menu interface.
For example, fig. 3 is a schematic diagram of an edit customization menu interface provided in the present application, as shown in fig. 3, since there are two test buttons in the current customization menu, namely, test button 1 and test button 2, the two buttons are displayed in the edit customization menu interface, and the user clicks the test button in this interface, so that the execution of the test will not be triggered.
In editing the custom menu interface, the user clicks the add button, and the test device displays a new button under the test button 2 of the editing custom menu interface in response to the user's operation. Further, when the user wants to edit the button, that is, input the related data, he needs to click the new button first.
After clicking the new button, the user can continue clicking the button corresponding to the name of the input button, and the test equipment responds to the operation of the user to display the name interface of the input button. The user can input the target button name in the interface, and after the user inputs the new button in the edit customization menu interface, the test equipment responds to the operation of the user after closing the input button name interface.
It should be noted that, the user may continue clicking the button corresponding to the input test execution parameter, and the test device displays the input test execution parameter interface in response to the operation of the user. The user may input test execution parameters at this interface and the user input completes closing the interface.
For example, the test execution parameters may include an execution speed and a number of execution repetitions, wherein the execution speed is available in a long representation for indicating a time interval between every two operation instructions. For example, the execution speed and the execution repetition number are set to: 100 milliseconds and 1 time, 200 milliseconds and 2 times, 300 milliseconds and 3 times, etc. It will be appreciated that the embodiment of the present application is not limited to a specific type of test execution parameter, and may be determined according to actual situations.
The user continues clicking the input test operation data button, and the test equipment responds to the operation of the user and displays a selection input mode interface. Fig. 4 is a schematic diagram of a selection input mode interface provided by the present application, and as shown in fig. 4, the selection input mode interface has a file loading button and an input command button.
If the user clicks the file loading button, the test equipment responds to the operation of the user and displays a file loading interface. FIG. 5 is a schematic diagram of a loading file interface provided by the present application, as shown in FIG. 5, in which a user clicks an add button, and a test device displays an add file interface in response to a user operation. The user can directly input the storage path of the test source file in the file adding interface, or can select the test source file displayed in the file adding interface, and further after the user closes the file adding interface, the test equipment responds to the operation of the user and displays the test source file in the file display area of the file loading interface. The user can add test source files for a plurality of times, and the test source files in the file display area are arranged according to the adding sequence.
The user can click the insert instruction button, the test equipment responds to the operation of the user and displays an input operation instruction interface, the user can input an operation instruction in the input operation instruction interface, and after the user closes the input operation instruction interface, the test equipment responds to the operation of the user and displays the operation instruction in the file display area.
The user can also select a test source file or an operation instruction in the file display area, and then click an up-shift or down-shift button, and the test equipment responds to the operation of the user to modify the sequence of the test source file or the operation instruction in the file display area. The user can also select the test source file or the operation instruction in the file display area, and then click the delete button, and the test equipment responds to the operation of the user to delete the test source file or the operation instruction from the file display area.
It should be noted that the test source file may not include any content, that is, the test source file is empty. The user may not add the test source file and the operation instruction, that is, the test operation data acquired by the test device is empty.
By adding a plurality of test source files and inserting operation instructions into the test source files, the flexibility of generating test buttons is improved.
And if the user clicks an input instruction button in the selection input mode interface, the test equipment responds to the operation of the user and displays the input instruction interface. Fig. 6 is a schematic diagram of an input instruction interface provided by the present application, as shown in fig. 6, in the interface, a user clicks an add button, a test device displays an input operation instruction interface in response to a user operation, the user inputs an operation instruction in the input operation instruction interface, and after the user closes the input operation instruction interface, the test device displays the operation instruction in an instruction display area in response to the user operation. The user can input the operation instructions a plurality of times, the operations in the instruction display area being arranged in the order of addition.
The user may also select an operation instruction in the instruction display area, and click an up or down button, and the test apparatus modifies the ordering of the operation instruction in the instruction display area in response to the user's operation. The user can also select an operation instruction in the instruction display area, and then click a delete button, and the test device deletes the operation instruction from the instruction display area in response to the operation of the user.
After closing the input instruction interface or loading the file interface, clicking a generation button in the edit custom menu interface, and then, responding to the operation of the user, the test equipment acquires the name of the target button, test operation data and test execution parameters input by the user.
In one embodiment, if the user does not click on a button corresponding to the input button name, that is, the user does not input the button name, after the user clicks on the generating button, the testing device takes the default button name as the target button name input by the user. The default button name may be: test button 1, test button 2, test button 3, etc., the embodiment of the application does not limit the default button name, and can be set according to actual conditions.
In one embodiment, before the user clicks the generate button, the user may also click an enter remark button in the edit customization menu interface, and the test device displays an enter remark interface in response to user operation, in which the user enters a remark, such as the action of the test button. And the user closes the remark inputting interface, clicks the generating button in the custom menu interface, and then the test equipment can acquire remarks input by the user, and stores the remarks after establishing a corresponding relation with the button names.
S202: analyzing the test operation data to generate a target test file.
In this step, after the test device obtains the name of the target button, the test operation data and the test execution parameters, in order for the test device to perform the test, the test operation data needs to be parsed to generate the target test file.
Illustratively, since the test operation data may include a test source file, and/or an operation instruction, the test apparatus may determine whether the test operation data includes the test source file, generating a determination result; and analyzing the test operation data according to the judgment result to generate a target test file. The judging result is used for indicating that the test operation data comprises a test source file or does not comprise the test source file.
It should be noted that the test file is an extensible markup language (Extensible Markup Language, abbreviated as XML) file.
S203: and selecting a target menu identifier which does not have a corresponding relation with the existing button name and the test file from the preset menu identifier list.
In this step, after the test device obtains the target button name and the test operation data, in order that the test device may obtain an operation instruction during the test later, a target menu identifier which has no corresponding relation with the existing button name and the test file is selected from the preset menu identifier list.
Specifically, the preset menu identifier list includes a plurality of menu identifiers, and some menu identifiers have corresponding relations with the button names and the test files, and some menu identifiers do not have corresponding relations with the button names and the test files, so that the test equipment can determine the menu identifiers which have no corresponding relations with the existing button names and the test files.
It should be noted that, the embodiment of the present application does not limit the number of menu identifiers in the preset menu identifier list, and may be determined according to actual situations. For example, the number of menu identifications in the preset menu identification list may be 10, 60, 80, 100, etc.
The execution sequence of step S202 and step S203 is not limited in the embodiment of the present application, and may be determined according to actual situations. Illustratively, the execution sequence for step S202 and step S203 may be: step S202 is executed first, and step S203 is executed, which may be: step S203 is executed first, and step S202 is executed, which may be: step S202 is performed simultaneously with step S203.
S204: and establishing a corresponding relation among the target button name, the target test file and the target menu identifier.
In this step, after the test device generates the target test file and obtains the target menu identifier, the corresponding relationship among the target button name, the target test file and the target menu identifier is established and stored.
In one embodiment, the manner of establishing the correspondence between the button name, the test file and the menu identifier may be: the test equipment stores a corresponding relation table, each row in the corresponding relation table represents a corresponding relation, and the corresponding relation table comprises a button name column, a test file column and a menu identification column; and respectively writing the button name, the test file and the menu identifier into a button name column, a test file column and a menu identifier column by taking the button name, the test file and the menu identifier as one line of data, so as to establish a corresponding relation.
In one embodiment, the manner of establishing the correspondence between the button name, the test file and the menu identifier may be: the testing equipment stores the button name, the testing file and the menu identifier as a group of corresponding relation data to establish a corresponding relation; each set of correspondence data represents a correspondence.
In one embodiment, the manner of establishing the correspondence between the button name, the test file and the menu identifier may be: the testing equipment stores a button name, a testing file and a menu identifier by adopting a key-value pair (key-value), takes the menu identifier as a key and takes the button name and the testing file as the value, so that the establishment of a corresponding relation is realized; each key value pair represents a correspondence.
The embodiment of the application does not limit the mode of establishing the corresponding relation among the button name, the test file and the menu identifier, and can be determined according to actual conditions.
In one embodiment, the test device may further determine whether the test execution parameter input by the user can be obtained, if the user inputs the test execution parameter in the edit custom menu interface, the test device may obtain the test execution parameter input by the user after the user clicks the generation button in the edit custom menu interface, and then establish a corresponding relationship between the name of the target button and the test execution parameter.
If the user does not input the test execution parameters in the edit custom menu interface, the test equipment does not acquire the test execution parameters input by the user, and a corresponding relation is established between the target button name and the preset test execution parameters.
S205: and responding to the confirmation generating operation of the user, and generating a test button according to the corresponding relation.
In this step, after storing the corresponding relation between the target button name, the target test file and the target menu identifier, the test device displays the generated success prompt message, and the user can click the confirm button in the edit custom menu interface, and the test device responds to the confirm generation operation of the user and generates the test button according to the target button name in the newly-established corresponding relation. Specifically, the target button name may be displayed on the generated test button, and the generated test button may be displayed in a custom menu. The newly established corresponding relation is used for generating the test button, so that after a subsequent user clicks the test button, the test equipment can quickly and readily find the corresponding test file according to the button name of the test button and then test the test file.
In one embodiment, instead of step 205, after the user clicks the confirm button in the edit custom menu interface, the test device may generate the test button by: the test equipment responds to the confirmation generation operation of the user, and if the corresponding relation between the menu identification and the button name and the test file exists for each menu identification in the preset menu identification list, a test button is generated according to the button name corresponding to the menu identification, the corresponding button name is displayed on the generated test button, and the generated test button is displayed in the user-defined menu. In the embodiment, the test equipment adopts a traversing mode to find all menu identifiers which have established corresponding relations with the button names and the test files in the preset menu identifier list, so that a plurality of test buttons can be simultaneously generated for testing different types, and the efficiency is high.
Fig. 7 is a schematic diagram of a custom menu provided by the present application, and as shown in fig. 7, the custom menu includes 3 test buttons, namely, a test button 1, a test button 2 and a test button 3.
In one embodiment, if a user selects a test button in the edit custom menu interface, then clicks a delete button, and clicks a confirm button, the test device responds to the user operation to delete the test button in the custom menu, delete the test execution parameter and the corresponding test file corresponding to the button name of the test button, and delete the corresponding relation between the button name and the test file and the menu identifier and the corresponding relation between the button name and the test execution parameter.
In one embodiment, if the user selects a generated test button in the edit custom menu interface, further inputs the target button name, test operation data and test execution parameters, and clicks the generate and confirm button, the test device responds to the user operation to update the button name of the button, and updates the correspondence between the button name and the test file and the correspondence between the button name and the test execution parameters, which are similar to those in step S201-step S205, and the update process is not repeated here.
According to the test button generation method, after the target button name, the test operation data and the test execution parameters input by the user are acquired, the test operation data are analyzed, and a target test file is generated; further, a target menu identifier which does not have a corresponding relation with the existing button name and the test file in the preset menu identifier list is established with the corresponding relation with the target button name and the target test file; and finally, generating a test button according to the corresponding relation in response to the confirmation generation operation of the user. Compared with the prior art that a user is required to perform a test process, the test button can be generated by acquiring the name of the target button and the test operation data input by the user, and the generation efficiency is effectively improved. Furthermore, the test button is generated through the acquired target button name and the test operation data, and the generated test button not only can realize the combined function of the original button of the test equipment, but also can realize functions other than the combined function of the original button, and has strong adaptability and expandability. In addition, different test buttons are generated by selecting different target button names and test operation data, so that different test project requirements can be met.
Fig. 8 is a schematic flow chart of a second embodiment of a test button generating method provided by the present application, where the embodiment of the present application describes a case where test equipment parses test operation data according to a determination result of whether the test operation data includes a test source file, and generates a target test file. As shown in fig. 8, the test button generation method specifically includes the following steps:
S801: judging whether the test operation data comprises a test source file or not, and generating a judging result; if the judging result indicates that the test operation data comprises the test source file, executing step S802-step S804; if the determination result indicates that the test operation data does not include the test source file, step S805 to step S807 are performed.
In this step, after the test device obtains the name of the target button and the test operation data, the test device analyzes the test operation data in different ways according to whether the test operation data includes the test source file, so the test device can determine the analysis way of the test operation data by obtaining the above determination result.
S802: and analyzing each test source file included in the test operation data according to the file type of the test source file to obtain an operation instruction subset corresponding to the test source file.
In this step, if the test device determines that the determination result indicates that the test operation data includes the test source file, the test source file may be divided into two file types, i.e., an executable file and a programmable instrument standard command (Standard Commands for Programmable Instrument, abbreviated as SCPI) script file, so that according to the file type of the test source file, the test source file may be parsed in different parsing modes to obtain an operation instruction subset corresponding to the test source file.
If the file type of the test source file is an executable file, analyzing a target test protocol selected by a user from the test source file to obtain a plurality of operation instructions, wherein the operation instructions form an operation instruction subset.
If the file type of the test source file is an SCPI script file, the SCPI script file comprises a plurality of operation instructions, the operation instructions are divided into a write command and a read command, and then linkage commands corresponding to the write commands are acquired for each write command in the SCPI script file. And adding the linkage instruction to the corresponding write command to form an operation instruction subset.
S803: and generating an operation instruction set according to whether the test operation data comprises test instructions and operation instruction subsets corresponding to each test source file.
In this step, after obtaining the operation instruction subset corresponding to each test source file, the test device needs to continuously determine whether the test operation data includes an operation instruction.
If the test operation data comprises the test instructions, sequencing the operation instructions in the operation instruction subset corresponding to each test source file and the operation instructions in the test operation data according to the sequence of the test source file and the operation instructions in the test operation data to obtain an operation instruction set.
And if the test operation data does not comprise the test instructions, sequencing the operation instructions in the operation instruction subset corresponding to each test source file according to the sequence of the test source files in the test operation data to obtain an operation instruction set.
S804: and generating an extensible markup language file for processing the operation instruction set to obtain a target test file.
In the step, after the test equipment obtains an operation instruction set, the operation instruction set is serialized to generate an XML file, and a target test file is obtained.
S805: and for each operation instruction in the test operation data in turn, judging whether the instruction name of the operation instruction belongs to a preset instruction name set.
In this step, if the test device determines that the determination result indicates that the test operation data does not include the test source file, it is indicated that the test operation data includes only the operation instruction, and for each operation instruction in the test operation data, it is sequentially determined whether the instruction name of the operation instruction belongs to the preset instruction name set, so as to determine whether the operation instruction is valid, that is, whether the test device can operate according to the operation instruction.
S806: if the instruction name of the operation instruction does not belong to the preset instruction name set, deleting the operation instruction from the test operation data to obtain updated test operation data.
In this step, if the test device determines that the instruction name of the operation instruction does not belong to the preset instruction name set, which indicates that the operation instruction is invalid, the test device cannot operate according to the test instruction, and then the operation instruction is deleted from the test operation data, so as to obtain updated test operation data.
S807: and generating an extensible markup language file for processing the updated test operation data to obtain a target test file.
In the step, the test equipment deletes the operation instruction which does not belong to the preset instruction name set in the test operation data, and after the updated test operation data is obtained, the updated test operation data is serialized to generate an XML file, so as to obtain the target test file.
In one embodiment, after deleting the operation instruction which does not belong to the preset instruction name set in the test operation data, the test device may further perform a deduplication process. And deleting each operation instruction in the updated test operation data if the operation instruction is the same as the last operation instruction of the operation instruction, so as to obtain the test operation data after secondary updating. And then the test operation data after the secondary update is serialized to generate an XML file, and a target test file is obtained.
Illustratively, the method for determining whether two operation instructions are identical includes: if the operation instruction comprises an instruction name and an instruction parameter, and the instruction names and the instruction parameters of the two operation instructions are the same, the two operation instructions are determined to be the same. Illustratively, both operating instructions are: open:30. the instruction name is open, the instruction parameter is 30, and the two operation instructions are identical.
According to the test button generation method, the target test file is generated according to the judgment result of whether the test operation data comprise the test source file, so that the target test file can be generated by different test operation data, and compatibility is improved.
Fig. 9 is a schematic flow chart of a third embodiment of a test button generating method provided by the present application, where the embodiment of the present application describes a case of resolving and obtaining an operation instruction subset when a file type of a test source file is an executable file. As shown in fig. 9, the test button generation method specifically includes the following steps:
s901: and if the file type of the test source file is an executable file, displaying a plurality of test protocols included in the test source file.
In this step, after determining that the test operation data includes the test source file, if it is determined that the file type of the test source file is an executable file, the executable file may include a plurality of test protocols, and an operation instruction subset may be generated according to each test protocol. Accordingly, a plurality of test protocols included in the test source file are displayed so that a user selects a desired target test protocol.
Illustratively, the test source files of the executable file type include: and a series of executable files corresponding to the test measurement software mainly comprising the test suite software. The executable files corresponding to the software comprise different test protocols, such as serializer/deserializer (SERialize/DESerializer, for short: serdes) test protocol, double Data Rate (DDR) test protocol, universal serial bus (Universal Serial Bus, for short: USB) test protocol, peripheral component interconnect express (PERIPHERAL COMPONENT INTERCONNECT EXPRESS, for short: PCIE) test protocol, and the like.
For example, the test source file of the executable file type may be an executable file of test suite software corresponding to the test device itself or corresponding to other devices.
S902: and responding to the protocol selection operation of the user, and acquiring a target test protocol selected by the user from a plurality of test protocols.
In this step, after the test device displays a plurality of test protocols, the user may select according to the test condition, and the test device responds to the protocol selection operation of the user to obtain the target test protocol selected by the user from the plurality of test protocols.
S903: judging whether the version of the target test protocol belongs to a preset version range or not; if the version of the target test protocol belongs to the preset version range, executing step S904; if the version of the target test protocol does not belong to the preset version range, step S905 is performed.
In this step, after the test device obtains the target test protocol, it needs to determine whether the target test protocol is available, and whether the version of the target test protocol belongs to the preset version range.
S904: and analyzing the target test protocol to obtain an operation instruction subset corresponding to the test source file.
In this step, if the test device determines that the version of the target test protocol belongs to the preset version range, which indicates that the target test protocol is available, the test device analyzes the target test protocol to obtain an operation instruction subset corresponding to the test source file.
S905: and setting the operation instruction subset corresponding to the test source file as an empty set.
In this step, if the test device determines that the version of the target test protocol does not belong to the preset version range, which indicates that the target test protocol is unavailable, the test device sets the operation instruction set corresponding to the test source file as an empty set.
According to the test button generation method provided by the embodiment, when the file type of the test source file is an executable file, whether a target test protocol selected from a plurality of test protocols included in the test source file is available is judged, and when the target test protocol is available, an operation instruction set is obtained through analysis; when the target test protocol is unavailable, the operation instruction subset is set as an empty set, so that the success rate of generating the operation instruction subset is improved, and the situation that test buttons cannot be generated due to the fact that the operation instruction subset is missing is avoided.
Fig. 10 is a flowchart of a fourth embodiment of a test button generating method provided by the present application, where the embodiment of the present application describes a case of parsing to obtain an operation instruction subset when a file type of a test source file is an SCPI script file. As shown in fig. 10, the test button generation method specifically includes the following steps:
S1001: if the file type of the test source file is a programmable instrument standard command script file, judging whether the operation command is a writable write command for each operation command in the test source file.
In this step, after determining that the test operation data includes a test source file, the test device analyzes each test source file included in the test operation data according to a file type of the test source file, to obtain an operation instruction subset corresponding to the test source file.
Specifically, when the file type of the test source file is an SCPI script file, the operation instruction is divided into a read command and a write command, and the write command is further divided into a writable write command and a read-only write command; for writable write commands, the execution of the join instruction is required, so that for each operation instruction in the test source file, it is required to determine whether the operation instruction is a writable write command.
For example, due to different commands corresponding to different types of operation instructions, whether the operation instruction is a writable write command may be determined according to the type of operation instruction. The embodiment of the application does not limit the corresponding relation between the type of the operation instruction and the type of the command, and can be determined according to actual conditions.
SCPI is an ASCII-based instrument programming language for use by test equipment. The operation instructions in the SCPI script file are hierarchical based on the standard grammar of SCPI1999 and IEEE 488.2, and have the characteristic of command tree. The operation instructions in the SCPI script file are generally classified into the following types: numerical, boolean, discrete, character.
S1002: if the operation instruction is a writable write instruction, acquiring a linkage instruction corresponding to the operation instruction.
In this step, if the test device determines that the operation instruction is a writable write command, since each writable write command stored in the test device has a corresponding linkage instruction, the linkage instruction corresponding to the operation instruction can be obtained.
Illustratively, the operating instructions are: the door, which indicates that the door is open, is a writable write command. The corresponding linkage instruction is as follows: turn on the light, which indicates turning on the lamp. The embodiment of the application does not limit the operation instruction and the corresponding linkage instruction, and can be determined according to actual conditions.
In one embodiment, if the operation instruction is a read command or a read-only write command, the operation instruction does not need to be processed.
S1003: and adding linkage instructions corresponding to the operation instructions after the operation instructions for each operation instruction which is a writable writing command in the test source file to obtain an operation instruction subset corresponding to the test source file.
In this step, after determining the linkage instruction corresponding to each writable write command, the test device adds the linkage instruction corresponding to the operation instruction corresponding to each writable write command in the test source file after the operation instruction, so as to obtain the operation instruction subset corresponding to the test source file.
It should be noted that the SCPI script file may be a file stored in the test device itself, or may be a newly acquired file.
According to the test button generation method, when the file type of the test source file is the SCPI script file, the integrity of the operation instruction subset is ensured by adding the linkage instruction corresponding to the writable write command in the SCPI script file to the write command.
Fig. 11 is a schematic flow chart of a fifth embodiment of a test button generating method provided by the present application, and the embodiment of the present application describes a test situation of a test device. As shown in fig. 11, the test button generation method specifically includes the following steps:
S1101: and responding to the operation of clicking the test button by the user, and acquiring the button name of the test button.
In this step, after the test button is generated, for example, after the execution of step S205 is completed, the user may click on the test button, and the test apparatus acquires the button name of the test button in response to the user' S operation of clicking on the test button.
S1102: and acquiring a test file corresponding to the button name and a test execution parameter corresponding to the button name.
In this step, since the test device loads the test file into the memory after the test button is generated, the test device may obtain the test file corresponding to the button name from the memory according to the obtained button name and the correspondence between the button name, the menu identifier and the test file, and obtain the test execution parameter corresponding to the button name according to the correspondence between the button name and the test execution parameter.
Fig. 12 is a schematic diagram of a correspondence provided by the present application, as shown in fig. 12, a preset menu identifier list includes a menu identifier 1 and a menu identifier 2, the menu identifier 1 has a correspondence with a button name 1 and a test file 1, the menu identifier 2 has a correspondence with a button name 2 and a test file 2, the button name 1 has a correspondence with a test execution parameter 1, the button name 2 has a correspondence with a test execution parameter 2, the button name 1 has a correspondence with a remark 1, and the button name 2 has a correspondence with a remark 2.
S1103: and performing deserialization operation on the test file to obtain an operation instruction set.
In this step, after the test device obtains the test file, since the test file is an XML file after the operation instruction is serialized, the test file needs to be subjected to an anti-serialization operation, so as to obtain the operation instruction set.
S1104: and executing the operation instruction set according to the test execution parameters.
In this step, after the test device obtains the operation instruction set, the operation instruction set is executed according to the test execution parameters, that is, the operation instruction in the operation instruction set is executed, so as to implement the test.
In one embodiment, the user may also query remark information of a test button, and the test device determines the remark corresponding to the button name according to the name of the test button and the corresponding relationship between the button name and the remark, so as to display the remark, so that the user can check the remark conveniently.
According to the test button generation method, the test file and the test execution parameters are determined according to the corresponding relation among the button name, the menu identification and the test file and the corresponding relation between the button name and the test execution parameters, and then the test file is subjected to deserialization operation, so that an operation instruction set is obtained, and then the operation instruction set is executed according to the test execution parameters, one-touch test is realized, and the test efficiency is improved. In addition, since the test button is decoupled from the test operation data after being generated, the test operation data input by a user is not required to be used in the test, and therefore, the test button and the test process are not changed when the test operation data are changed.
Fig. 13 is a flowchart of a sixth embodiment of a test button generating method according to the present application, where the embodiment of the present application describes a case where a test button is generated and a test file is loaded without a user operation when a test device is started. As shown in fig. 13, the test button generation method specifically includes the following steps:
s1301: when the test equipment is started, for each menu identifier in a preset menu identifier list, if a corresponding relation exists between the menu identifier and the button name as well as between the menu identifier and the test file, a test button is generated according to the button name corresponding to the menu identifier.
In this step, when the test device is started, in order to improve the test efficiency, the test device generates a test button in the custom menu according to the button name corresponding to the menu identifier if the menu identifier has a corresponding relationship with the button name and the test file for each menu identifier in the preset menu identifier list, and displays the button name on the test button.
S1302: and loading the test file corresponding to the menu identifier into the memory.
In this step, after the test device generates the test button, in order to improve the test efficiency, a test file corresponding to the menu identifier is also loaded into the memory for use in the test.
It should be noted that, the test file loaded into the memory may be stored in the form of a temporary variable.
According to the test button generation method, the test button is generated and the test file is loaded when the test equipment is started, so that user operation is not needed, and the test efficiency can be effectively improved. In addition, after the test equipment is shut down and restarted, a user does not need to input a button name and test operation data again, the test button can be generated according to the button name corresponding to the menu identifier, and the corresponding relation between the menu identifier and the button name as well as the test file is stored in the test equipment, so that the test button is prevented from being lost due to shutdown.
The following are examples of the apparatus of the present application that may be used to perform the method embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method of the present application.
FIG. 14 is a schematic diagram of an embodiment of a test button generating device according to the present application; the device can be integrated in the test equipment in the method embodiment, and can also be realized by the test equipment in the method embodiment. As shown in fig. 14, the test button generation device 1400 includes:
an obtaining module 1401, configured to obtain a target button name and test operation data input by a user in response to a new test button operation of the user;
a processing module 1402 for:
analyzing the test operation data to generate a target test file;
Selecting a target menu identifier which has no corresponding relation with the existing button name and the test file from a preset menu identifier list;
Establishing a corresponding relation among the target button name, the target test file and the target menu identifier;
A generating module 1403, configured to generate a test button according to the correspondence in response to a confirmation generating operation of the user.
Further, the test operation data includes a test source file and/or an operation instruction, and the processing module 1402 is specifically configured to:
judging whether the test operation data comprises a test source file or not, and generating a judging result;
And analyzing the test operation data according to the judging result to generate the target test file.
Further, the processing module 1402 is specifically configured to:
If the judging result indicates that the test operation data comprises a test source file, analyzing the test source file according to the file type of the test source file for each test source file included in the test operation data to obtain an operation instruction subset corresponding to the test source file;
Generating an operation instruction set according to whether the test operation data comprises a test instruction and an operation instruction subset corresponding to each test source file;
and processing the operation instruction set to generate an extensible markup language file to obtain the target test file.
Further, the processing module 1402 is specifically configured to:
if the test operation data comprises test instructions, sequencing the operation instructions in the operation instruction subset corresponding to each test source file and the operation instructions in the test operation data according to the sequence of the test source file and the operation instructions in the test operation data to obtain an operation instruction set;
And if the test operation data does not comprise the test instruction, sequencing the operation instructions in the operation instruction subset corresponding to each test source file according to the sequence of the test source files in the test operation data to obtain the operation instruction set.
Further, the processing module 1402 is specifically configured to:
If the file type of the test source file is an executable file, displaying a plurality of test protocols included in the test source file;
responding to the protocol selection operation of the user, and acquiring a target test protocol selected by the user from the plurality of test protocols;
judging whether the version of the target test protocol belongs to a preset version range or not;
if the version of the target test protocol belongs to a preset version range, analyzing the target test protocol to obtain an operation instruction subset corresponding to the test source file;
And if the version of the target test protocol does not belong to the preset version range, setting the operation instruction subset corresponding to the test source file as an empty set.
Further, the processing module 1402 is specifically configured to:
If the file type of the test source file is a programmable instrument standard command script file, judging whether each operation instruction in the test source file is a writable write command or not;
if the operation instruction is a writable write instruction, acquiring a linkage instruction corresponding to the operation instruction;
And adding linkage instructions corresponding to the operation instructions after the operation instructions for each operation instruction which is a writable writing command in the test source file to obtain an operation instruction subset corresponding to the test source file.
Further, the processing module 1402 is specifically configured to:
If the judging result indicates that the test operation data does not comprise the test source file, judging whether the instruction name of each operation instruction in the test operation data belongs to a preset instruction name set or not;
if the instruction name of the operation instruction does not belong to a preset instruction name set, deleting the operation instruction from the test operation data to obtain updated test operation data;
And generating an extensible markup language file for processing the updated test operation data to obtain the target test file.
Further, the processing module 1402 is further configured to:
if the test execution parameters input by the user are acquired, establishing a corresponding relation between the target button name and the test execution parameters;
if the test execution parameters input by the user are not acquired, establishing a corresponding relation between the target button name and the preset test execution parameters.
Further, the acquiring module 1401 is further configured to:
responding to the operation of clicking a test button by a user, and acquiring the button name of the test button;
acquiring a test file corresponding to the button name and a test execution parameter corresponding to the button name;
further, the processing module 1402 is further configured to:
performing deserialization operation on the test file to obtain an operation instruction set;
And executing the operation instruction set according to the test execution parameters.
The test button generating device provided in this embodiment is configured to execute the technical scheme of the test device in any one of the foregoing method embodiments, and its implementation principle and technical effect are similar, and are not described herein again.
Fig. 15 is a schematic structural diagram of a test apparatus according to the present application. As shown in fig. 15, the test apparatus 1500 includes:
a processor 1501, a memory 1502, and a communication interface 1503;
the memory 1502 is configured to store executable instructions of the processor 1501;
wherein the processor 1501 is configured to execute the technical solution of the test device in any of the method embodiments described above via execution of the executable instructions.
Alternatively, the memory 1502 may be separate or integrated with the processor 1501.
Optionally, when the memory 1502 is a device separate from the processor 1501, the test apparatus 1500 may further include:
bus 1504, memory 1502 and communication interface 1503 are connected to processor 1501 via bus 1504 and communicate with each other, communication interface 1503 being used to communicate with other devices.
Alternatively, the communication interface 1503 may be implemented specifically by a transceiver. The communication interface is used to enable communication between the database access apparatus and other devices (e.g., clients, read-write libraries, and read-only libraries). The memory may include random access memory (random access memory, RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
Bus 1504 may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The processor may be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; but may also be a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
The test device is used for executing the technical scheme of the test device in any method embodiment, and the implementation principle and the technical effect are similar, and are not repeated here.
The embodiment of the application also provides a readable storage medium, on which a computer program is stored, which when being executed by a processor, implements the technical solution provided by any of the foregoing method embodiments.
The embodiment of the application also provides a computer program product, which comprises a computer program, wherein the computer program is used for realizing the technical scheme provided by any one of the method embodiments when being executed by a processor.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features can be replaced equivalently; such modifications and substitutions do not depart from the spirit of the application.

Claims (9)

1. A test button generation method, characterized by being applied to a test apparatus, the method comprising:
responding to a new test button operation of a user, and acquiring a target button name and test operation data input by the user, wherein the test operation data comprises a test source file and/or an operation instruction;
judging whether the test operation data comprises a test source file or not, and generating a judging result;
analyzing the test operation data according to the judging result to generate a target test file;
Selecting a target menu identifier which has no corresponding relation with the existing button name and the test file from a preset menu identifier list;
Establishing a corresponding relation among the target button name, the target test file and the target menu identifier;
generating a test button according to the corresponding relation in response to the confirmation generation operation of the user;
analyzing the test operation data according to the judging result to generate the target test file, including:
If the judging result indicates that the test operation data comprises a test source file, analyzing the test source file according to the file type of the test source file for each test source file included in the test operation data to obtain an operation instruction subset corresponding to the test source file;
Generating an operation instruction set according to whether the test operation data comprises a test instruction and an operation instruction subset corresponding to each test source file;
generating an extensible markup language file for processing the operation instruction set to obtain the target test file;
The generating an operation instruction set according to whether the test operation data includes a test instruction and an operation instruction subset corresponding to each test source file includes:
if the test operation data comprises test instructions, sequencing the operation instructions in the operation instruction subset corresponding to each test source file and the operation instructions in the test operation data according to the sequence of the test source file and the operation instructions in the test operation data to obtain an operation instruction set;
If the test operation data does not comprise the test instruction, sequencing the operation instructions in the operation instruction subset corresponding to each test source file according to the sequence of the test source files in the test operation data to obtain the operation instruction set;
analyzing the test source file according to the file type of the test source file to obtain an operation instruction subset corresponding to the test source file, including:
If the file type of the test source file is an executable file, displaying a plurality of test protocols included in the test source file;
responding to the protocol selection operation of the user, and acquiring a target test protocol selected by the user from the plurality of test protocols;
judging whether the version of the target test protocol belongs to a preset version range or not;
if the version of the target test protocol belongs to a preset version range, analyzing the target test protocol to obtain an operation instruction subset corresponding to the test source file;
And if the version of the target test protocol does not belong to the preset version range, setting the operation instruction subset corresponding to the test source file as an empty set.
2. The method of claim 1, wherein parsing the test source file according to the file type of the test source file to obtain a subset of operation instructions corresponding to the test source file comprises:
If the file type of the test source file is a programmable instrument standard command script file, judging whether each operation instruction in the test source file is a writable write command or not;
if the operation instruction is a writable write instruction, acquiring a linkage instruction corresponding to the operation instruction;
And adding linkage instructions corresponding to the operation instructions after the operation instructions for each operation instruction which is a writable writing command in the test source file to obtain an operation instruction subset corresponding to the test source file.
3. The method of claim 1, wherein the parsing the test operation data according to the determination result to generate a target test file includes:
If the judging result indicates that the test operation data does not comprise the test source file, judging whether the instruction name of each operation instruction in the test operation data belongs to a preset instruction name set or not;
if the instruction name of the operation instruction does not belong to a preset instruction name set, deleting the operation instruction from the test operation data to obtain updated test operation data;
And generating an extensible markup language file for processing the updated test operation data to obtain the target test file.
4. A method according to any one of claims 1-3, wherein the method further comprises:
if the test execution parameters input by the user are acquired, establishing a corresponding relation between the target button name and the test execution parameters;
if the test execution parameters input by the user are not acquired, establishing a corresponding relation between the target button name and the preset test execution parameters.
5. A method according to any one of claims 1-3, wherein the method further comprises:
responding to the operation of clicking a test button by a user, and acquiring the button name of the test button;
acquiring a test file corresponding to the button name and a test execution parameter corresponding to the button name;
performing deserialization operation on the test file to obtain an operation instruction set;
And executing the operation instruction set according to the test execution parameters.
6. A test button generation device, comprising:
the acquisition module is used for responding to the newly-added test button operation of the user and acquiring the target button name and the test operation data input by the user, wherein the test operation data comprises a test source file and/or an operation instruction;
A processing module for:
judging whether the test operation data comprises a test source file or not, and generating a judging result;
analyzing the test operation data according to the judging result to generate a target test file;
Selecting a target menu identifier which has no corresponding relation with the existing button name and the test file from a preset menu identifier list;
Establishing a corresponding relation among the target button name, the target test file and the target menu identifier;
the generating module is used for responding to the confirmation generating operation of the user and generating a test button according to the corresponding relation;
The processing module is specifically configured to:
If the judging result indicates that the test operation data comprises a test source file, analyzing the test source file according to the file type of the test source file for each test source file included in the test operation data to obtain an operation instruction subset corresponding to the test source file;
Generating an operation instruction set according to whether the test operation data comprises a test instruction and an operation instruction subset corresponding to each test source file;
generating an extensible markup language file for processing the operation instruction set to obtain the target test file;
The processing module is specifically further configured to:
if the test operation data comprises test instructions, sequencing the operation instructions in the operation instruction subset corresponding to each test source file and the operation instructions in the test operation data according to the sequence of the test source file and the operation instructions in the test operation data to obtain an operation instruction set;
If the test operation data does not comprise the test instruction, sequencing the operation instructions in the operation instruction subset corresponding to each test source file according to the sequence of the test source files in the test operation data to obtain the operation instruction set;
The processing module is specifically further configured to:
If the file type of the test source file is an executable file, displaying a plurality of test protocols included in the test source file;
responding to the protocol selection operation of the user, and acquiring a target test protocol selected by the user from the plurality of test protocols;
judging whether the version of the target test protocol belongs to a preset version range or not;
if the version of the target test protocol belongs to a preset version range, analyzing the target test protocol to obtain an operation instruction subset corresponding to the test source file;
And if the version of the target test protocol does not belong to the preset version range, setting the operation instruction subset corresponding to the test source file as an empty set.
7. A test apparatus, comprising:
A processor, a memory, a communication interface;
The memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the test button generation method of any one of claims 1 to 5 via execution of the executable instructions.
8. A readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the test button generation method of any one of claims 1 to 5.
9. A computer program product comprising a computer program for implementing the test button generation method of any one of claims 1 to 5 when executed by a processor.
CN202410494600.1A 2024-04-24 2024-04-24 Test button generation method, device, equipment, medium and product Active CN118069541B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410494600.1A CN118069541B (en) 2024-04-24 2024-04-24 Test button generation method, device, equipment, medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410494600.1A CN118069541B (en) 2024-04-24 2024-04-24 Test button generation method, device, equipment, medium and product

Publications (2)

Publication Number Publication Date
CN118069541A CN118069541A (en) 2024-05-24
CN118069541B true CN118069541B (en) 2024-06-25

Family

ID=91095655

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410494600.1A Active CN118069541B (en) 2024-04-24 2024-04-24 Test button generation method, device, equipment, medium and product

Country Status (1)

Country Link
CN (1) CN118069541B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114706746A (en) * 2022-02-23 2022-07-05 马上消费金融股份有限公司 Test file generation method and device and storage medium
CN116974929A (en) * 2023-07-31 2023-10-31 远光软件股份有限公司 Automatic test tool construction method, automatic test method and related equipment thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8799866B2 (en) * 2011-05-31 2014-08-05 International Business Machines Corporation Automatic generation of user interfaces
CN117667658A (en) * 2022-08-31 2024-03-08 河南昆仑技术有限公司 Test program generating method and test program generating device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114706746A (en) * 2022-02-23 2022-07-05 马上消费金融股份有限公司 Test file generation method and device and storage medium
CN116974929A (en) * 2023-07-31 2023-10-31 远光软件股份有限公司 Automatic test tool construction method, automatic test method and related equipment thereof

Also Published As

Publication number Publication date
CN118069541A (en) 2024-05-24

Similar Documents

Publication Publication Date Title
US8010844B2 (en) File mutation method and system using file section information and mutation rules
US6651240B1 (en) Object-oriented software development support apparatus and development support method
CN106874176B (en) Intelligent test method and device
US7730466B2 (en) System and method for manipulating source code in a text editor
CN110990274A (en) Data processing method, device and system for generating test case
CN105512276B (en) Method and device for constructing junk file and electronic equipment
CN112631704A (en) Interface element identification method and device, storage medium and electronic equipment
CN116107892A (en) Automatic test method, device, equipment and storage medium
CN107341100A (en) The collocation method and device of camera parameter
CN118069541B (en) Test button generation method, device, equipment, medium and product
JP7318704B2 (en) Test equipment, test method and program
CN115755867A (en) Vehicle diagnosis method and related device
CN114968817A (en) Method, device, equipment and storage medium for evaluating code change influence range
CN111459547B (en) Method and device for displaying function call link
US6763516B2 (en) Convention checking apparatus, convention checking system, convention checking method, and storage medium on which is recorded a convention checking program
CN117369789B (en) Method for generating code based on visual configuration tool and visual display device
CN114647570B (en) Code increment coverage statistics method, device, computer equipment and storage medium
CN113741956B (en) Method and device for transplanting version management function, version management method and device
CN115729557B (en) Script processing method and device
CN118377726B (en) Web application automatic test method and computer device
JPH11338686A (en) Program development support device, its method and medium for recording program development support program
CN111858310B (en) Method, system, equipment and medium for dynamic test based on source code
CN117056416B (en) Flexible construction and management method for visualized data set model
US20060004535A1 (en) Creation and storage of simulated application-instrument communications
CN117453713A (en) SQL sentence generation method, device and storage medium for multi-type database

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant