CN104199767B - Test method and device - Google Patents
Test method and device Download PDFInfo
- Publication number
- CN104199767B CN104199767B CN201410409965.6A CN201410409965A CN104199767B CN 104199767 B CN104199767 B CN 104199767B CN 201410409965 A CN201410409965 A CN 201410409965A CN 104199767 B CN104199767 B CN 104199767B
- Authority
- CN
- China
- Prior art keywords
- test
- format
- tester
- library file
- interactive interface
- 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
Links
- 238000010998 test method Methods 0.000 title claims abstract description 6
- 238000012360 testing method Methods 0.000 claims abstract description 407
- 230000002452 interceptive effect Effects 0.000 claims abstract description 59
- 238000000034 method Methods 0.000 claims abstract description 21
- 238000012545 processing Methods 0.000 claims description 9
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000013522 software testing Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
- Tests Of Electronic Circuits (AREA)
Abstract
The invention provides a test method and a test device, wherein the test method comprises the steps of displaying an interactive interface of a test library file to a tester, wherein the test library file has a preset parameter input format; receiving test parameters input by a tester in the interactive interface according to the preset parameter input format; generating a test case based on the received test parameters, wherein the test case represents content information required by the test; and testing the test object according to the test case. The method can reduce the requirements on testers, is convenient for the testers to use, and realizes the test automation.
Description
Technical Field
The invention relates to the technical field of automation, in particular to a testing method and a testing device.
Background
Software testing can identify the correctness, integrity, security, and quality of software. Software testing may operate on a program under specified conditions to discover bugs, to measure software quality, and to evaluate whether it can meet design requirements.
In the prior art, a tester needs to know the application range, the advantages and the disadvantages of a plurality of test tools, and then selects a proper test tool according to the characteristics of a test object and a running platform, and finally completes a test case by using a programming language required by the test tool. And the method has higher requirements on personnel writing and maintaining the test cases.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, one objective of the present invention is to provide a testing method, which can reduce the requirements on the testers, facilitate the use of the testers, and realize the automation of the test.
Another object of the present invention is to provide a testing device.
In order to achieve the above object, an embodiment of the first aspect of the present invention provides a testing method, including: displaying an interactive interface of a test library file to a tester, wherein the test library file has a preset parameter input format;
receiving test parameters input by a tester in the interactive interface according to the preset parameter input format; generating a test case based on the received test parameters, wherein the test case represents content information required by the test; and testing the test object according to the test case.
Optionally, the interactive interface includes format information representing the preset parameter input format;
receiving test parameters input by a tester in the interactive interface according to the preset parameter input format, specifically:
and receiving the test parameters input by the tester in the interactive interface according to the preset parameter input format represented by the format information.
Optionally, the format information includes a parameter input position and/or a parameter physical meaning.
Optionally, the method further includes:
and displaying the preset parameter input format to the tester, and displaying the meaning of each parameter corresponding to the preset parameter input format.
Optionally, the format of the test library file includes:
extensible markup language (XML) format; or,
a spreadsheet; or,
a text format; or,
the configuration file ini file format.
Optionally, the test parameters include the following information:
the type of operation;
an operation target;
a test result is expected.
Optionally, the testing the test object according to the test case includes:
determining an operation item corresponding to the operation type in the test case according to a preset corresponding relation between the operation type and the operation item;
executing the processing operation represented by the operation item to the operation object represented by the operation target to obtain an actual operation result;
and determining the execution situation according to the actual operation result and the expected test result in the test case.
Optionally, the operation item includes at least one of the following items:
keyboard operation items on a computer, mouse operation items on the computer and operation items on a smart phone.
In the testing method provided by the embodiment of the first aspect of the invention, the testing library file is displayed to the testing personnel, the testing library file has the preset parameter input format, and the testing parameters input by the testing personnel in the interactive interface according to the preset parameter input format are received, so that the testing can be performed by the testing personnel inputting according to the preset format, the requirements on the testing personnel are effectively reduced, the testing personnel can use the testing method conveniently, and the testing automation is realized.
In order to achieve the above object, a testing apparatus according to an embodiment of the second aspect of the present invention includes: the interactive module is used for displaying an interactive interface of a test library file to a tester, wherein the test library file has a preset parameter input format; the receiving module is used for receiving the test parameters input by the tester in the interactive interface according to the preset parameter input format; the generating module is used for generating a test case based on the received test parameters, and the test case represents content information required by the test; and the test module is used for testing the test object according to the test case.
Optionally, the interactive interface includes format information indicating the preset parameter input format, and the receiving module is specifically configured to:
and receiving the test parameters input by the tester in the interactive interface according to the preset parameter input format represented by the format information.
Optionally, the format information includes a parameter input position and/or a parameter physical meaning.
Optionally, the apparatus further comprises:
and the display module is used for displaying the preset parameter input format to the tester and displaying the meaning of each parameter corresponding to the preset parameter input format.
Optionally, the format of the test library file includes:
extensible markup language (XML) format; or,
a spreadsheet; or,
a text format; or,
the configuration file ini file format.
Optionally, the test parameters include the following information:
the type of operation;
an operation target;
a test result is expected.
Optionally, the test module is specifically configured to:
determining an operation item corresponding to the operation type in the test case according to a preset corresponding relation between the operation type and the operation item;
executing the processing operation represented by the operation item to the operation object represented by the operation target to obtain an actual operation result;
and determining the execution situation according to the actual operation result and the expected test result in the test case.
Optionally, the operation item includes at least one of the following items:
keyboard operation items on a computer, mouse operation items on the computer and operation items on a smart phone.
According to the testing device provided by the embodiment of the second aspect of the invention, the testing library file is displayed to the testing personnel, the testing library file has the preset parameter input format, and the testing parameters input by the testing personnel in the interactive interface according to the preset parameter input format are received, so that the testing can be performed by the testing personnel inputting according to the preset format, the requirements on the testing personnel are effectively reduced, the use by the testing personnel is facilitated, and the testing automation is realized.
In order to achieve the above object, a testing apparatus according to a third embodiment of the present invention includes: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the testing device; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the steps of: displaying an interactive interface of a test library file to a tester, wherein the test library file has a preset parameter input format; receiving test parameters input by a tester in the interactive interface according to the preset parameter input format; generating a test case based on the received test parameters, wherein the test case represents content information required by the test; and testing the test object according to the test case.
Optionally, the interactive interface includes format information representing the preset parameter input format;
receiving test parameters input by a tester in the interactive interface according to the preset parameter input format, specifically:
and receiving the test parameters input by the tester in the interactive interface according to the preset parameter input format represented by the format information.
Optionally, the format information includes a parameter input position and/or a parameter physical meaning.
Optionally, the method further includes:
and displaying the preset parameter input format to the tester, and displaying the meaning of each parameter corresponding to the preset parameter input format.
Optionally, the format of the test library file includes:
extensible markup language (XML) format; or,
a spreadsheet; or,
a text format; or,
the configuration file ini file format.
Optionally, the test parameters include the following information:
the type of operation;
an operation target;
a test result is expected.
Optionally, the testing the test object according to the test case includes:
determining an operation item corresponding to the operation type in the test case according to a preset corresponding relation between the operation type and the operation item;
executing the processing operation represented by the operation item to the operation object represented by the operation target to obtain an actual operation result;
and determining the execution situation according to the actual operation result and the expected test result in the test case.
Optionally, the operation item includes at least one of the following items:
keyboard operation items on a computer, mouse operation items on the computer and operation items on a smart phone.
The testing device provided by the embodiment of the third aspect of the invention displays the test library file to the tester, wherein the test library file has the preset parameter input format, and receives the test parameters input by the tester in the interactive interface according to the preset parameter input format, so that the tester can perform testing according to the input of the preset format, the requirements on the tester are effectively reduced, the tester can use the testing device conveniently, and the testing automation is realized.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a schematic flow chart of a testing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a testing method according to another embodiment of the present invention;
FIG. 3 is a schematic diagram of an exemplary test method according to an embodiment of the present invention;
FIG. 4 is a schematic view of a drawing a according to an embodiment of the present invention;
FIG. 5 is a schematic view of a drawing b according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating parameters in an embodiment of the present invention;
FIG. 7 is a schematic diagram of a spreadsheet form test case in an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a testing apparatus according to another embodiment of the present invention;
fig. 9 is a schematic structural diagram of a testing apparatus according to another embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention. On the contrary, the embodiments of the invention include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
Fig. 1 is a schematic flow chart of a testing method according to an embodiment of the present invention, where the method includes:
s11: and displaying an interactive interface of a test library file to a tester, wherein the test library file has a preset parameter input format.
The testing device in the embodiment of the invention can provide an interface for a tester in a library file mode.
The format of the test library file includes: extensible Markup Language (XML) format, spreadsheet, text format (txt), or ini file format, an ini file is a configuration file.
S12: and receiving the test parameters input by the tester in the interactive interface according to the preset parameter input format.
Optionally, the interactive interface includes format information indicating the preset parameter input format, and correspondingly, receives the test parameters input by the tester in the interactive interface according to the preset parameter input format, specifically:
and receiving the test parameters input by the tester in the interactive interface according to the preset parameter input format represented by the format information.
Optionally, the format information includes a parameter input position and/or a parameter physical meaning.
For example, when the test library file is a spreadsheet, the spreadsheet may be displayed in the interactive interface, and the spreadsheet may include keywords according to which the tester may input corresponding values.
In another embodiment, the method may further include: and displaying the preset parameter input format to the tester, and displaying the meaning of each parameter corresponding to the preset parameter input format.
For example, when the test library file is an ini file, the positions of the parameters and the physical meanings of the parameters contained in the ini file to be input can be displayed to the user, and a tester can input the test parameters on the interactive interface according to the displayed content.
The test parameters may include: the identification information of the test case, for example, a name or a number, may be specifically represented by a number or a character string; the operation types, such as mouse click, mouse double click or keyboard input, may be specifically represented by different numbers; an operation target for indicating an object to be subjected to a test operation, such as a picture stored in a specified position, and the like, which may be specifically represented by a character string; the expected test result is used for indicating an expected result after the test operation is performed on the test object so as to detect the software execution condition, and can be specifically represented by a character string.
S13: and generating a test case based on the received test parameters, wherein the test case represents content information required by the test.
After each test parameter is determined, a corresponding test case can be generated based on the test parameter. For example, the number or name of the corresponding test case may be identified by the input identification information, and the operation action to be executed by the test case may be identified by the input operation type.
S14: and testing the test object according to the test case.
The specific test flow may include: determining an operation item corresponding to the operation type in the test case according to a preset corresponding relation between the operation type and the operation item;
executing the processing operation represented by the operation item to the operation object represented by the operation target to obtain an actual operation result;
and determining the execution situation according to the actual operation result and the expected test result in the test case.
Optionally, the operation item includes at least one of the following items:
keyboard operation items on a computer, mouse operation items on the computer and operation items on a smart phone.
For example, according to the operation indicated by the operation type, the corresponding operation is performed on the object indicated by the operation target, and after the operation is performed, whether the actual test result is consistent with the expected test result is detected.
When the number of the test cases is at least two, each test case can be executed once according to the above flow.
In the embodiment, the test library file is displayed to the tester, the test library file has the preset parameter input format, and receives the test parameters input by the tester in the interactive interface according to the preset parameter input format, so that the tester can test according to the input of the preset format, the requirement on the tester can be reduced, the tester can use the test library file conveniently, and the test automation is realized.
Fig. 2 is a schematic flow chart of a testing method according to another embodiment of the present invention, the method including:
s21: establishing a test device comprising: support modules and library files.
The support module can be completed by a test developer and is used for analyzing the content in the library file and executing a specific test case.
The library file is an interface provided by the test device to the outside, and a tester can input a test case in the library file.
The format of the library file may include: XML format, spreadsheet, txt format, or ini format.
Specifically, the library file may be used to display an interactive interface of the test library file to a tester, where the test library file has a preset parameter input format; receiving test parameters input by a tester in the interactive interface according to the preset parameter input format; and generating a test case based on the received test parameters, wherein the test case represents content information required by the test.
The support module can be used for testing the test object according to the test case.
S22: and the library file receives the test parameters input by the tester and generates a test case according to the test parameters.
The library file contains parameter lists which need to be filled by common testers, and provides an interface for inputting parameters for the common testers, so that the common testers can input corresponding parameters of test cases conveniently.
Specifically, the library file can show an interactive interface of the test library file to a tester, wherein the test library file has a preset parameter input format;
the test parameters may include:
identification information of the test case, such as a name or a number;
operation types, wherein the operation categories on a Personal Computer (PC) include keyboard operations and mouse operations, and the keyboard operations may include: the single key input and the combination key input, and the mouse operation may include: single click, double click, drag, and scroll wheel operation. The operation types on the smartphone may include click and drag.
It can be understood that other division modes may be adopted when the operation types are divided, as long as it is ensured that the support module can understand the operation types input in the library file, for example, the mouse operation may include clicking a single time, clicking twice continuously, clicking a left button, clicking a right button, and the like.
Different operation types may be represented by different numbers, e.g. 1 for mouse double click, 2 for mouse drag, etc.
The operation target is used for indicating an object indicated by the operation type, for example, a click position needs to be given when clicking, and the click position can be represented in the form of coordinates, pictures or control id and the like; the keyboard input needs to give specific input content, such as character strings input by the keyboard.
A test result is expected for detecting the execution result of the software to be tested.
Taking the library file format as an ini file format as an example, a test case may be shown in fig. 3, wherein schematic diagrams of a picture a and a picture b may respectively refer to fig. 4 or fig. 5, and the test case may be used to automatically open a QQ login window by double-clicking a desktop shortcut and determine an execution result.
Optionally, to facilitate understanding of the tester, the library file may provide information descriptions such as an explanation description of each parameter and a filling rule of the parameter value for the tester, and the tester may fill the corresponding parameter value according to the explanation description when testing.
For example, after a tester opens a library file, the library file may present a parameter interpretation 61 as shown in fig. 6 to the user to guide the tester to input test cases before inputting test cases.
Fig. 3 illustrates an ini file format as an example, and the library file format may also be a spreadsheet, as shown in fig. 7, which shows a test case having the same contents as those in fig. 3 in a spreadsheet form. Specifically, in fig. 7, the first line is agreed to represent a keyword, and the corresponding portion in the ini file of fig. 3 is "left part", the second line and the following lines are used to fill in specific values, and the corresponding portion in the ini file of fig. 3 is "right part". For a detailed description of the various parameters, reference may be made to fig. 6.
S23: the support module loads the library file and executes the test according to the test case in the library file.
When a test developer establishes a test device, the test developer needs to set a support module to load a library file, read the contents of the library file, and understand the meaning of the parameters of the test case. For example, it may be preset in the support module that, after receiving an instruction to start running from a user, the library file is automatically loaded and parameters of test cases in the library file are read, and the support module presets a corresponding relationship between a parameter value and a specific meaning, for example, a mouse double click is performed when an operation type is set to 1, so that, when the parameter value of the read operation type is 1, the support module performs a mouse double click operation, and for example, an operation target is set to represent a corresponding operation object, and then, after the support module reads the parameter value of the operation target, the object specified by the parameter value is subjected to the operation indicated by the operation type.
After the support module performs the operation indicated by the operation type on the object indicated by the operation target, the actual operation result can be read and compared with the object specified by the expected operation result to judge the execution condition, and a test report can be generated according to the execution condition. The test report may include the specific contents of the error when the two are the same, or otherwise fail the test, or the like.
The embodiment provides the interface externally in a library file mode, and the library file has a preset parameter input format, so that the library file is popular and easy to understand for testers, and the testers do not need to write professional test codes, so that the requirement on the testers can be reduced, the use of the testers is facilitated, and the test automation is realized. According to the embodiment, the parameters of the test cases are explained in advance, so that the testers can know the relevant information, the user can conveniently input the test cases, and the user experience is improved.
Fig. 8 is a schematic structural diagram of a testing apparatus according to another embodiment of the present invention, where the apparatus 80 includes an interaction module 81, a receiving module 82, a generating module 83, and a testing module 84.
The interaction module 81 is used for displaying an interaction interface of a test library file to a tester, wherein the test library file has a preset parameter input format;
the testing device in the embodiment of the invention can provide an interface for a tester in a library file mode.
The format of the test library file includes: extensible Markup Language (XML) format, spreadsheet, text format (txt), or ini file format, an ini file being a configuration file
The receiving module 82 is configured to receive the test parameters input by the tester in the interactive interface according to the preset parameter input format;
optionally, the interactive interface includes format information representing the preset parameter input format, and the receiving module 82 is specifically configured to: and receiving the test parameters input by the tester in the interactive interface according to the preset parameter input format represented by the format information.
Optionally, the format information includes a parameter input position and/or a parameter physical meaning.
For example, when the test library file is a spreadsheet, the spreadsheet may be displayed in the interactive interface, and the spreadsheet may include keywords according to which the tester may input corresponding values.
Referring to fig. 9, in another embodiment, the apparatus 80 may further include: and the display module 85 is used for displaying the preset parameter input format to the tester and displaying the meaning of each parameter corresponding to the preset parameter input format.
For example, when the test library file is an ini file, the positions of the parameters and the physical meanings of the parameters contained in the ini file to be input can be displayed to the user, and a tester can input the test parameters on the interactive interface according to the displayed content.
The test parameters may include: the identification information of the test case, for example, a name or a number, may be specifically represented by a number or a character string; the operation types, such as mouse click, mouse double click or keyboard input, may be specifically represented by different numbers; an operation target for indicating an object to be subjected to a test operation, such as a picture stored in a specified position, and the like, which may be specifically represented by a character string; the expected test result is used for indicating an expected result after the test operation is performed on the test object so as to detect the software execution condition, and can be specifically represented by a character string.
The generating module 83 is configured to generate a test case based on the received test parameters, where the test case represents content information required by the test;
after each test parameter is determined, a corresponding test case can be generated based on the test parameter. For example, the number or name of the corresponding test case may be identified by the input identification information, and the operation action to be executed by the test case may be identified by the input operation type.
The test module 84 is configured to test the test object according to the test case.
Optionally, the test module 84 is specifically configured to:
determining an operation item corresponding to the operation type in the test case according to a preset corresponding relation between the operation type and the operation item;
executing the processing operation represented by the operation item to the operation object represented by the operation target to obtain an actual operation result;
and determining the execution situation according to the actual operation result and the expected test result in the test case.
Optionally, the operation item includes at least one of the following items:
keyboard operation items on a computer, mouse operation items on the computer and operation items on a smart phone.
In another embodiment, the specific operation item includes at least one of:
keyboard operation items on a computer, mouse operation items on the computer and operation items on a smart phone.
The operation categories on a Personal Computer (PC) include a keyboard operation and a mouse operation, and the keyboard operation may include: the single key input and the combination key input, and the mouse operation may include: single click, double click, drag, and scroll wheel operation. The operation types on the smartphone may include click and drag.
It can be understood that other division modes may be adopted when the operation types are divided, as long as it is ensured that the test module can understand the operation types input in the library file, for example, the mouse operation may include clicking a single time, clicking twice continuously, clicking a left button, clicking a right button, and the like.
When the number of the test cases is at least two, each test case can be executed once according to the above flow.
Specifically, the test parameters may include:
identification information of the test case, such as a name or a number;
operation types, wherein the operation categories on a Personal Computer (PC) include keyboard operations and mouse operations, and the keyboard operations may include: the single key input and the combination key input, and the mouse operation may include: single click, double click, drag, and scroll wheel operation. The operation types on the smartphone may include click and drag.
It can be understood that other division modes may be adopted when the operation types are divided, as long as it is ensured that the test module can understand the operation types input in the library file, for example, the mouse operation may include clicking a single time, clicking twice continuously, clicking a left button, clicking a right button, and the like.
Different operation types may be represented by different numbers, e.g. 1 for mouse double click, 2 for mouse drag, etc.
The operation target is used for indicating an object indicated by the operation type, for example, a click position needs to be given when clicking, and the click position can be represented in the form of coordinates, pictures or control id and the like; the keyboard input needs to give specific input content, such as character strings input by the keyboard.
A test result is expected for detecting the execution result of the software to be tested.
Taking the library file format as an ini file format as an example, a test case may be shown in fig. 3, wherein schematic diagrams of a picture a and a picture b may respectively refer to fig. 4 or fig. 5, and the test case may be used to automatically open a QQ login window by double-clicking a desktop shortcut and determine an execution result.
Optionally, to facilitate understanding of the tester, the library file may provide information descriptions such as an explanation description of each parameter and a filling rule of the parameter value for the tester, and the tester may fill the corresponding parameter value according to the explanation description when testing.
For example, after a tester opens the library file, the library file may present a parameter interpretation as shown in FIG. 6 to the user to guide the tester to input test cases before inputting test cases.
When a test developer establishes a test device, the test developer needs to set a test module to load a test library file, read the contents of the test library file, and understand the meaning of the parameters of the test case. For example, after receiving an instruction of starting operation from a user, the test module may preset a parameter of a test case in which a test library file is automatically loaded and read, and the test module preset a corresponding relationship between a parameter value and a specific meaning, for example, a mouse double click is performed when an operation type is set to 1, so that when the parameter value of the read operation type is 1, the support module 82 performs a mouse double click operation, and for example, when an operation target is set to represent a corresponding operation object, the test module reads the parameter value of the operation target, and then performs the operation indicated by the operation type on the object specified by the parameter value.
After the test module performs the operation indicated by the operation type on the object indicated by the operation target, the actual operation result can be read and compared with the object specified by the expected operation result to judge the execution condition, and a test report can be generated according to the execution condition. The test report may include the specific contents of the error when the two are the same, or otherwise fail the test, or the like.
The embodiment provides the interface externally in a library file mode, and the library file has a preset parameter input format, so that the library file is popular and easy to understand for testers, and the testers do not need to write professional test codes, so that the requirement on the testers can be reduced, the use of the testers is facilitated, and the test automation is realized.
The embodiment of the invention also provides client equipment which comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power circuit for supplying power to each circuit or device of the client device; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the steps of:
s11': and displaying an interactive interface of a test library file to a tester, wherein the test library file has a preset parameter input format.
The testing device in the embodiment of the invention can provide an interface for a tester in a library file mode.
The format of the test library file includes: extensible Markup Language (XML) format, spreadsheet, text format (txt), or ini file format, an ini file is a configuration file.
S12': and receiving the test parameters input by the tester in the interactive interface according to the preset parameter input format.
Optionally, the interactive interface includes format information indicating the preset parameter input format, and correspondingly, receives the test parameters input by the tester in the interactive interface according to the preset parameter input format, specifically:
and receiving the test parameters input by the tester in the interactive interface according to the preset parameter input format represented by the format information.
Optionally, the format information includes a parameter input position and/or a parameter physical meaning.
For example, when the test library file is a spreadsheet, the spreadsheet may be displayed in the interactive interface, and the spreadsheet may include keywords according to which the tester may input corresponding values.
In another embodiment, the method may further include: and displaying the preset parameter input format to the tester, and displaying the meaning of each parameter corresponding to the preset parameter input format.
For example, when the test library file is an ini file, the positions of the parameters and the physical meanings of the parameters contained in the ini file to be input can be displayed to the user, and a tester can input the test parameters on the interactive interface according to the displayed content.
The test parameters may include: the identification information of the test case, for example, a name or a number, may be specifically represented by a number or a character string; the operation types, such as mouse click, mouse double click or keyboard input, may be specifically represented by different numbers; an operation target for indicating an object to be subjected to a test operation, such as a picture stored in a specified position, and the like, which may be specifically represented by a character string; the expected test result is used for indicating an expected result after the test operation is performed on the test object so as to detect the software execution condition, and can be specifically represented by a character string.
S13': and generating a test case based on the received test parameters, wherein the test case represents content information required by the test.
After each test parameter is determined, a corresponding test case can be generated based on the test parameter. For example, the number or name of the corresponding test case may be identified by the input identification information, and the operation action to be executed by the test case may be identified by the input operation type.
S14': and testing the test object according to the test case.
The specific test flow may include: determining an operation item corresponding to the operation type in the test case according to a preset corresponding relation between the operation type and the operation item;
executing the processing operation represented by the operation item to the operation object represented by the operation target to obtain an actual operation result;
and determining the execution situation according to the actual operation result and the expected test result in the test case.
Optionally, the operation item includes at least one of the following items:
keyboard operation items on a computer, mouse operation items on the computer and operation items on a smart phone.
For example, according to the operation indicated by the operation type, the corresponding operation is performed on the object indicated by the operation target, and after the operation is performed, whether the actual test result is consistent with the expected test result is detected.
When the number of the test cases is at least two, each test case can be executed once according to the above flow.
In the embodiment, the test library file is displayed to the tester, the test library file has the preset parameter input format, and receives the test parameters input by the tester in the interactive interface according to the preset parameter input format, so that the tester can test according to the input of the preset format, the requirement on the tester can be reduced, the tester can use the test library file conveniently, and the test automation is realized.
In another embodiment, the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the steps of:
s21': establishing a test device comprising: support modules and library files.
The support module can be completed by a test developer and is used for analyzing the content in the library file and executing a specific test case.
The library file is an interface provided by the test device to the outside, and a tester can input a test case in the library file.
The format of the library file may include: XML format, spreadsheet, txt format, or ini format.
Specifically, the library file may be used to display an interactive interface of the test library file to a tester, where the test library file has a preset parameter input format; receiving test parameters input by a tester in the interactive interface according to the preset parameter input format; and generating a test case based on the received test parameters, wherein the test case represents content information required by the test.
The support module can be used for testing the test object according to the test case.
S22': and the library file receives the test parameters input by the tester and generates a test case according to the test parameters.
The library file contains parameter lists which need to be filled by common testers, and provides an interface for inputting parameters for the common testers, so that the common testers can input corresponding parameters of test cases conveniently.
Specifically, the library file can show an interactive interface of the test library file to a tester, wherein the test library file has a preset parameter input format;
the test parameters may include:
identification information of the test case, such as a name or a number;
operation types, wherein the operation categories on a Personal Computer (PC) include keyboard operations and mouse operations, and the keyboard operations may include: the single key input and the combination key input, and the mouse operation may include: single click, double click, drag, and scroll wheel operation. The operation types on the smartphone may include click and drag.
It can be understood that other division modes may be adopted when the operation types are divided, as long as it is ensured that the support module can understand the operation types input in the library file, for example, the mouse operation may include clicking a single time, clicking twice continuously, clicking a left button, clicking a right button, and the like.
Different operation types may be represented by different numbers, e.g. 1 for mouse double click, 2 for mouse drag, etc.
The operation target is used for indicating an object indicated by the operation type, for example, a click position needs to be given when clicking, and the click position can be represented in the form of coordinates, pictures or control id and the like; the keyboard input needs to give specific input content, such as character strings input by the keyboard.
A test result is expected for detecting the execution result of the software to be tested.
Taking the library file format as an ini file format as an example, a test case may be shown in fig. 3, wherein schematic diagrams of a picture a and a picture b may respectively refer to fig. 4 or fig. 5, and the test case may be used to automatically open a QQ login window by double-clicking a desktop shortcut and determine an execution result.
Optionally, to facilitate understanding of the tester, the library file may provide information descriptions such as an explanation description of each parameter and a filling rule of the parameter value for the tester, and the tester may fill the corresponding parameter value according to the explanation description when testing.
For example, after a tester opens a library file, the library file may present a parameter interpretation 61 as shown in fig. 6 to the user to guide the tester to input test cases before inputting test cases.
Fig. 3 illustrates an ini file format as an example, and the library file format may also be a spreadsheet, as shown in fig. 7, which shows a test case having the same contents as those in fig. 3 in a spreadsheet form. Specifically, in fig. 7, the first line is agreed to represent a keyword, and the corresponding portion in the ini file of fig. 3 is "left part", the second line and the following lines are used to fill in specific values, and the corresponding portion in the ini file of fig. 3 is "right part". For a detailed description of the various parameters, reference may be made to fig. 6.
S23': the support module loads the library file and executes the test according to the test case in the library file.
When a test developer establishes a test device, the test developer needs to set a support module to load a library file, read the contents of the library file, and understand the meaning of the parameters of the test case. For example, it may be preset in the support module that, after receiving an instruction to start running from a user, the library file is automatically loaded and parameters of test cases in the library file are read, and the support module presets a corresponding relationship between a parameter value and a specific meaning, for example, a mouse double click is performed when an operation type is set to 1, so that, when the parameter value of the read operation type is 1, the support module performs a mouse double click operation, and for example, an operation target is set to represent a corresponding operation object, and then, after the support module reads the parameter value of the operation target, the object specified by the parameter value is subjected to the operation indicated by the operation type.
After the support module performs the operation indicated by the operation type on the object indicated by the operation target, the actual operation result can be read and compared with the object specified by the expected operation result to judge the execution condition, and a test report can be generated according to the execution condition. The test report may include the specific contents of the error when the two are the same, or otherwise fail the test, or the like.
The embodiment provides the interface externally in a library file mode, and the library file has a preset parameter input format, so that the library file is popular and easy to understand for testers, and the testers do not need to write professional test codes, so that the requirement on the testers can be reduced, the use of the testers is facilitated, and the test automation is realized. According to the embodiment, the parameters of the test cases are explained in advance, so that the testers can know the relevant information, the user can conveniently input the test cases, and the user experience is improved.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium. The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.
Claims (14)
1. A method of testing, comprising:
establishing a testing device, wherein the testing device comprises a support module and a library file, and the support module is used for analyzing the content in the library file and executing a test case;
displaying an interactive interface of a test library file to a tester, wherein the test library file has a preset parameter input format;
displaying the preset parameter input format to the tester, and displaying the meaning of each parameter corresponding to the preset parameter input format;
receiving test parameters input by a tester in the interactive interface according to the preset parameter input format on the interactive interface;
generating a test case based on the received test parameters, wherein the test case represents content information required by the test;
and the support module loads the library file and tests a test object according to a test case in the library file, wherein the support module presets a corresponding relation between a parameter value and a specific meaning, and after reading the parameter value of an operation target, the support module performs operation indicated by the operation type on the object specified by the parameter value.
2. The method according to claim 1, wherein the interactive interface includes format information representing the preset parameter input format;
receiving test parameters input by a tester in the interactive interface according to the preset parameter input format, specifically:
and receiving the test parameters input by the tester in the interactive interface according to the preset parameter input format represented by the format information.
3. Method according to claim 2, wherein the format information comprises parameter input position and/or parameter physical meaning.
4. The method of claim 1, wherein the format of the test library file comprises:
extensible markup language (XML) format; or,
a spreadsheet; or,
a text format; or,
the configuration file ini file format.
5. The method according to any of claims 1 to 4, wherein the test parameters comprise the following information:
the type of operation;
an operation target;
a test result is expected.
6. The method of claim 5, wherein the testing the test object according to the test case comprises:
determining an operation item corresponding to the operation type in the test case according to a preset corresponding relation between the operation type and the operation item;
executing the processing operation represented by the operation item to the operation object represented by the operation target to obtain an actual operation result;
and determining the execution situation according to the actual operation result and the expected test result in the test case.
7. The method of claim 6, wherein the operation items comprise at least one of:
keyboard operation items on a computer, mouse operation items on the computer and operation items on a smart phone.
8. A test apparatus, comprising:
the interactive module is used for displaying an interactive interface of a test library file to a tester, wherein the test library file has a preset parameter input format;
the display module is used for displaying the preset parameter input format to the tester and displaying the meaning of each parameter corresponding to the preset parameter input format;
the receiving module is used for receiving the test parameters input in the interactive interface by a tester on the interactive interface according to the preset parameter input format;
the generating module is used for generating a test case based on the received test parameters, and the test case represents content information required by the test;
and the test module is used for testing the test object according to the test case, wherein the test module presets the corresponding relation between the parameter value and the specific meaning, and after reading the parameter value of the operation target, the test module performs the operation indicated by the operation type on the object specified by the parameter value.
9. The apparatus according to claim 8, wherein the interactive interface includes format information indicating the preset parameter input format, and the receiving module is specifically configured to:
and receiving the test parameters input by the tester in the interactive interface according to the preset parameter input format represented by the format information.
10. The apparatus of claim 9, wherein the format information comprises a parameter input location and/or a parameter physical meaning.
11. The apparatus of claim 8, wherein the format of the test library file comprises:
extensible markup language (XML) format; or,
a spreadsheet; or,
a text format; or,
the configuration file ini file format.
12. The apparatus according to any one of claims 8 to 11, wherein the test parameters comprise the following information:
the type of operation;
an operation target;
a test result is expected.
13. The apparatus of claim 12, wherein the testing module is specifically configured to:
determining an operation item corresponding to the operation type in the test case according to a preset corresponding relation between the operation type and the operation item;
executing the processing operation represented by the operation item to the operation object represented by the operation target to obtain an actual operation result;
and determining the execution situation according to the actual operation result and the expected test result in the test case.
14. The apparatus of claim 12, wherein the operation items comprise at least one of:
keyboard operation items on a computer, mouse operation items on the computer and operation items on a smart phone.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410409965.6A CN104199767B (en) | 2014-08-19 | 2014-08-19 | Test method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410409965.6A CN104199767B (en) | 2014-08-19 | 2014-08-19 | Test method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104199767A CN104199767A (en) | 2014-12-10 |
CN104199767B true CN104199767B (en) | 2017-08-29 |
Family
ID=52085063
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410409965.6A Active CN104199767B (en) | 2014-08-19 | 2014-08-19 | Test method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104199767B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108241577A (en) * | 2016-12-27 | 2018-07-03 | 百度在线网络技术(北京)有限公司 | test method and device |
CN107357729A (en) * | 2017-07-07 | 2017-11-17 | 广东中星电子有限公司 | The method and electronic equipment of test software |
CN109426611A (en) * | 2017-08-31 | 2019-03-05 | 贵州白山云科技股份有限公司 | A kind of method for testing software and device |
CN109471788A (en) * | 2017-12-29 | 2019-03-15 | 北京安天网络安全技术有限公司 | A kind of domestic operating system software automated testing method and system |
CN108763070A (en) * | 2018-05-16 | 2018-11-06 | 北京金山云网络技术有限公司 | Generation method, device and the electronic equipment of test data |
CN109460368A (en) * | 2018-11-22 | 2019-03-12 | 北京同有飞骥科技股份有限公司 | Automatic test approach, device and storage medium based on syntax conversion |
CN110083527A (en) * | 2019-03-18 | 2019-08-02 | 平安普惠企业管理有限公司 | A kind of generation method and device, electronic equipment of test case |
CN110704317A (en) * | 2019-09-26 | 2020-01-17 | 凡普数字技术有限公司 | Method, device and storage medium for testing parameter rule of interface parameter |
CN114268569B (en) * | 2020-09-16 | 2023-10-31 | 中盈优创资讯科技有限公司 | Configurable network operation and maintenance acceptance test method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1622022A1 (en) * | 2004-07-22 | 2006-02-01 | Siemens Aktiengesellschaft | Automatic generation of test cases |
CN1983209A (en) * | 2005-12-14 | 2007-06-20 | 中兴通讯股份有限公司 | System and method for automatically testing software unit |
CN101339534A (en) * | 2008-06-17 | 2009-01-07 | 金蝶软件(中国)有限公司 | Software test apparatus and test method |
CN103049371A (en) * | 2012-11-07 | 2013-04-17 | 青岛海信传媒网络技术有限公司 | Testing method and testing device of Android application programs |
CN103246601A (en) * | 2012-02-10 | 2013-08-14 | 腾讯科技(深圳)有限公司 | Testing method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103186457A (en) * | 2011-12-29 | 2013-07-03 | 阿里巴巴集团控股有限公司 | Method and device for automatically generating test case |
-
2014
- 2014-08-19 CN CN201410409965.6A patent/CN104199767B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1622022A1 (en) * | 2004-07-22 | 2006-02-01 | Siemens Aktiengesellschaft | Automatic generation of test cases |
CN1983209A (en) * | 2005-12-14 | 2007-06-20 | 中兴通讯股份有限公司 | System and method for automatically testing software unit |
CN101339534A (en) * | 2008-06-17 | 2009-01-07 | 金蝶软件(中国)有限公司 | Software test apparatus and test method |
CN103246601A (en) * | 2012-02-10 | 2013-08-14 | 腾讯科技(深圳)有限公司 | Testing method and device |
CN103049371A (en) * | 2012-11-07 | 2013-04-17 | 青岛海信传媒网络技术有限公司 | Testing method and testing device of Android application programs |
Also Published As
Publication number | Publication date |
---|---|
CN104199767A (en) | 2014-12-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104199767B (en) | Test method and device | |
US10222955B2 (en) | Automatically capturing user interactions and evaluating user interfaces in software programs using field testing | |
CN103518393B (en) | The system and method for detecting mobile communication equipment content | |
US9021428B2 (en) | Troubleshooting visuals and transient expressions in executing applications | |
US9454466B2 (en) | Explaining partially illegal combinations in combinatorial models | |
US9141518B2 (en) | GUI testing | |
CA2773721C (en) | Code validation using content assist | |
US9465724B2 (en) | Method, program, and system for generating test cases | |
CN109739855B (en) | Method and system for realizing data sheet splicing and automatically training machine learning model | |
US20070250815A1 (en) | Measuring code coverage | |
CN113449877B (en) | Method and system for demonstrating machine learning modeling process | |
CN107180117B (en) | Chart recommendation method and device and computer equipment | |
US20200379886A1 (en) | Refining coverage analyses using context information | |
US20080127037A1 (en) | System and method for detecting software on a computing device | |
US9703683B2 (en) | Software testing coverage | |
US8984487B2 (en) | Resource tracker | |
US9292611B1 (en) | Accessing information from a firmware using two-dimensional barcodes | |
US10884905B2 (en) | Test script creation based on abstract test user controls | |
CN102231127A (en) | System and method for detecting BIOS (Basic Input Output System) wrong information display | |
US8397114B2 (en) | Automated regression testing intermediary | |
CN110489333A (en) | A kind of method, apparatus based on detector tune-up data, medium and electronic equipment | |
US20130326466A1 (en) | Human Readable Software Program Test Step | |
GB2553896B (en) | Product test orchestration | |
US20120005540A1 (en) | Search suggestions for static code analysis | |
US20130061206A1 (en) | Automatically generating executable code for a test sequence |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20181210 Address after: 519030 Room 105-53811, No. 6 Baohua Road, Hengqin New District, Zhuhai City, Guangdong Province Patentee after: Zhuhai Leopard Technology Co.,Ltd. Address before: 100085 East District, Second Floor, 33 Xiaoying West Road, Haidian District, Beijing Patentee before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd. |