CN114490330A - Method and device for generating test case - Google Patents
Method and device for generating test case Download PDFInfo
- Publication number
- CN114490330A CN114490330A CN202111613318.3A CN202111613318A CN114490330A CN 114490330 A CN114490330 A CN 114490330A CN 202111613318 A CN202111613318 A CN 202111613318A CN 114490330 A CN114490330 A CN 114490330A
- Authority
- CN
- China
- Prior art keywords
- test
- test object
- trigger event
- test case
- generating
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
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 method for generating a test case, which comprises the steps of monitoring a trigger event; determining a test object corresponding to the trigger event; determining an operation keyword corresponding to the trigger event according to the trigger event; determining a test object keyword corresponding to the test object according to the test object; and generating a test case by using the operation keywords and the test object keywords. According to some example embodiments of the present application, by mapping the test object and the trigger event to the predefined keyword and generating the test case by using the trigger event and the test object, not only can the manually written test case be replaced, but also the automated test case can be generated and the automated test can be directly performed. The standardization of the manual test case is maintained, the complicated explanation and comparison process of the automatic test case and the manual test case is omitted, and the working efficiency of testing personnel is improved.
Description
Technical Field
The application relates to the field of automatic testing, in particular to a method and a device for generating a test case.
Background
In the software testing process, when the test case is edited, in order to improve the readability of the test case, the written test case needs to be explained in a screenshot mode in most cases; after the execution is completed according to the test case, the test result and the test case are often required to be correspondingly compared.
Because the test cases are compiled without a uniform standard, the test cases compiled by different testers have different words for the same operation, and the problem of inconsistent description contents occurs. In addition, the test case for the computer to execute the automated test is written by using the computer language, and the readability is not high. The test cases manually compiled by testers do not have a unified standard, and are not convenient to be directly used for software automated testing, so that the corresponding relation between the manually compiled test cases and the software automated test cases needs to be manually compared after the automated testing is usually executed.
The above problems result in that the manual test case and the automatic test case cannot be shared, so that the whole test process is relatively complicated, and time and labor are wasted.
Disclosure of Invention
The application provides a method and a device for generating test cases, which are used for solving the problems that manual test cases are inconsistent in compiling and labeling and manual test cases are inconsistent with automatic test cases.
According to one aspect of the application, a method for generating a test case is provided, the method includes monitoring a trigger event; determining a test object corresponding to the trigger event; determining an operation keyword corresponding to the trigger event according to the trigger event; determining a test object keyword corresponding to the test object according to the test object; and generating a test case by using the operation keywords and the test object keywords.
According to some embodiments, determining the operation object corresponding to the trigger event includes acquiring a test object by using an application interface provided by an operating system;
according to some embodiments, the determining the test object corresponding to the trigger event comprises: and acquiring the test object by utilizing the position information of the trigger event in a display interface.
According to some embodiments, the determining the test object corresponding to the trigger event includes determining the test object corresponding to the trigger event by using trigger position information of the trigger event in the display interface and an element layout mode of the display interface.
According to some embodiments, the trigger event and the operation keyword have a pre-established mapping relationship; and/or the test object and the test object keyword have a pre-established mapping relationship.
According to some embodiments, before generating the test case by using the operation keywords and the test object keywords, the method further comprises acquiring data related to the test object input by an input device.
According to some embodiments, the input device includes a keyboard, a mouse, and a touch screen.
According to some embodiments, the generating a test case by using the operation keyword and the test object keyword comprises generating a test case by using the operation keyword, the test object keyword and data related to a test object input by the input device.
According to some embodiments, after generating a test case using the operation keyword and the test object keyword, the method further comprises storing the test case in a dictionary format.
According to some embodiments, the generated test case is editable.
According to some embodiments, after generating a test case using the operation keywords and the test object keywords, the method further includes performing an automated test using the test case and generating a test report.
According to an aspect of the present application, an apparatus for generating a test case is provided, the apparatus including: the trigger event acquisition module is used for monitoring trigger events; the test object acquisition module is used for determining a test object corresponding to the trigger event; an operation keyword acquisition module, configured to determine, according to the trigger event, an operation keyword corresponding to the trigger event; the test object keyword acquisition module is used for determining a test object keyword corresponding to the test object according to the test object; and the test case generating module is used for generating a test case by using the test object keywords and the operation keywords.
According to an aspect of the present application, an apparatus for generating test cases is provided, the apparatus comprising one or more processors; storage means for storing one or more programs; when executed by the one or more processors, cause the one or more processors to implement a method as in any one of the preceding claims.
According to some example embodiments of the present application, by mapping the test object and the trigger event to the predefined keyword and generating the test case by using the trigger event and the test object, not only can the manually written test case be replaced, but also the automated test case can be generated and the automated test can be directly performed. The standardization of the manual test case is maintained, the complicated explanation and comparison process of the automatic test case and the manual test case is omitted, and the working efficiency of testing personnel is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly introduced below.
FIG. 1 illustrates a system architecture diagram for generating test cases according to an exemplary embodiment of the present application.
FIG. 2 is a flowchart illustrating a method for generating test cases according to an exemplary embodiment of the present disclosure.
Fig. 3 is a block diagram of an apparatus for generating a test case according to an exemplary embodiment of the present application.
Fig. 4a shows a login box.
Fig. 4b shows a flow chart of a method of operating a login box.
Fig. 5 is a block diagram of another apparatus for generating test cases according to an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the embodiments of the disclosure can be practiced without one or more of the specific details, or with other means, components, materials, devices, or operations. In such cases, well-known structures, methods, devices, implementations, materials, or operations are not shown or described in detail.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
In the existing test, in the initial stage of software development, the developed software functions are often manually tested in a mode of writing test cases. After the software development is completed, in the subsequent iteration process, an automatic test case which can be identified by the software often needs to be written so as to facilitate the computer to execute the automatic test.
At present, when manual test cases are written, because the descriptions of testers are not uniform, the differences of the test cases written by different testers are very large. Therefore, for understanding, the description of the written test case is often required to be performed by the screenshot. In addition, the manual test case and the automatic test case are different in applicable objects, and the machine cannot be identified when the test case is manually compiled, so that the test case for the automatic test is not convenient for a tester to understand, and the readability is not high, so that the manual test case and the automatic test case cannot be shared, the automatic test result and the manual test case need to be in one-to-one correspondence after the automatic test is executed each time, the process is complicated, and the efficiency is not high.
Based on the problems existing at present, the test case generated by the embodiment of the application can be conveniently understood by the tester and can be used as an automatic test case, so that the explanation process of the automatic test case and the manual test case and the complicated comparison process between the automatic test case and the manual test case are omitted, and the working efficiency of the tester is improved.
FIG. 1 is a diagram illustrating a system architecture for generating test cases according to an example embodiment of the present application. A system for generating test cases according to an exemplary embodiment of the present application, as shown in fig. 1, is to generate test cases related to operations in a process of operating a program under test. The following describes in detail a system operation process for generating test cases according to an exemplary embodiment of the present application by taking fig. 1 as an example.
Firstly, according to the test case to be generated, the tested program is run, and the test operation related to the test case to be generated is executed. For example, enter a username in a username entry box or click a login button.
The module Case generation engine is used for capturing the whole operation process of the tested program, and the captured content comprises an operation object, an operation action and/or input data related to the operation object.
For example, a user name is input in a user name input box, the "user name input box" is an operation object, the "input" is an operation action, and the "input user name" is input data related to the operation object.
For another example, a login button is clicked, a "click" is an operation action, and a "login button" is an operation action.
And the module tested program is executed to generate the test Case Cases according to the whole operation process captured by the module Case generation engine.
For example, assuming that the Name attribute value of the UserName input box is UserName, if the UserName flower is input in the UserName input box, the corresponding test case generated by the module tested program execution is the user flower input in the UserName input box.
For another example, assuming that the Name attribute value of the Password input box is Password, if the Password input in the Password input box is 123456, the corresponding test case generated by the module under test program execution is 123456 input in the Password input box.
For another example, assuming that the Name attribute value of the Login button is Login, when the Login button is clicked, the corresponding test case generated by the module under test program is clicked.
And finally, the module tested program executes to store the generated test case in a dictionary format.
For example, the dictionary of stored test cases may be:
{
in the "UserName" input box: the input "TRUN @ grr.la",
in the "passage" input box: the input "TRUN @ grr.la",
click on "Login" button: observe whether the login failure window appears
}。
The module Case export engine is used for exporting test cases, can generate manual cases and automatic cases simultaneously, and can export the cases respectively according to needs. The manual cases can be exported in an Excel format, so that a tester can conveniently read and execute a manual test, and an automatic test report can be generated conveniently; the automatic cases can be exported in an XML format, so that the module Case execution engine can conveniently execute the automatic test and generate an automatic test report.
Since the computer can recognize the dictionary format, the test case in the dictionary format can be directly used for the automatic test. In addition, the manual test case may be generated using a test case in a dictionary format.
For example, the generated manual test case is a 'UserName' input box, where TRun @ grr.la is input; in the 'passage' input box, inputting 'TRUN @ grr.la'; clicking a 'Login' button to observe whether a Login failure window appears.
FIG. 2 is a flowchart illustrating a method for generating test cases according to an exemplary embodiment of the present disclosure. A method for generating a test case according to an exemplary embodiment of the present application is described below with reference to fig. 2.
As shown in fig. 2, in step S201, a trigger event is listened to.
According to some embodiments of the present application, the trigger event includes a mouse operation action, such as a click, a right click, a double click, a long press, and a swipe. According to some embodiments, mouse operation actions may be obtained by capturing mouse events.
According to some embodiments, the triggering event includes a keyboard entry action, such as a keyboard press, a keyboard pop-up, and a keyboard entry. According to some embodiments, a keyboard operation action may be obtained by capturing a keyboard event.
According to some embodiments, the trigger event includes a touch input action, such as a touch slide event, a touch move-off event, and a touch move-in event.
In step S203, a test object corresponding to the trigger event is determined.
According to some embodiments, the test object is an application object of the trigger event.
For example, clicking a login button, clicking a trigger event, and clicking the login button is the subject of the application test of the trigger event.
For another example, a close dialog, "close" is a trigger event, and a dialog is an application test object that triggers the event "close".
For another example, a slider bar, "slider" is a trigger event, and a slider bar "is an application test object that triggers the event" slider ".
According to some example embodiments of the present application, the test object and the trigger event are obtained by an application interface provided by an operating system, for example, the test object and the trigger event of the operation are obtained by using a UI Automation function of microsoft or an auxiliary Automation test function of android.
According to some embodiments, for a test object which cannot acquire the attribute of the test element or a test object which does not conform to the auxiliary automation test, for example, a GDI + drawn interface, a test object which does not start the support of the auxiliary automation test in QT development, first acquiring the position information of the trigger event in the display interface, and determining the test object according to the page layout and the relative position of the test object at the page boundary.
According to some embodiments, the trigger event and the test object are obtained by using an input device, such as a mouse, a keyboard or a touch screen, and the corresponding event name and the corresponding event attribute value.
For example, the mouse events corresponding to the Windows system include a click event (onclick), a double click event (ondblclick), a mouse pass event (onmouseover), a mouse out event and a mouse out event (onmouseout), the position of the test object is obtained by using attributes of the mouse events, such as clientX, clientY, offsetX, offsetY, pageX, pageY, screenX, screenY, layerX and layerY, and the test object corresponding to the trigger event is determined by using trigger position information of the trigger event in the display interface and an element layout manner of the display interface.
For another example, the keyboard events corresponding to the Windows system include a keyboard press event (onkeydown) and a keyboard pop event (onkeyup), and the operation object is acquired by using the keyboard events, such as keyCode, charCode, target, and srclement attributes.
For another example, the touch screen event of the mobile terminal includes a touch start event (touchstart), a slide event (touchmove), and a touch end event (touchend), and the position of the test object is obtained by using touch attributes, such as clientX, clientY, pageX, pageY, screenX, screenY, and identifier, and the test object is obtained by using coordinate position information of the trigger event in the display interface.
It should be noted that, according to the application interface provided by the operating system, the test object may be obtained first, or the trigger event may be obtained first. The specific operation sequence can be determined according to the test object. The difference between the execution sequence of step S201 and step S203 does not affect the final result.
In step S205, an operation keyword corresponding to the trigger event is determined according to the trigger event.
According to some example embodiments of the present application, before step S205 is executed, a mapping relationship between the trigger event and the operation keyword needs to be established, so that the same trigger event has a uniform name, which is convenient for a tester to identify the trigger event, and improves readability of a finally generated test case.
For example, clicking the corresponding operation keyword by the left mouse button is clicking, and the format of the generated test case is clicking X, wherein X is the mouse clicking object. For example, the left mouse button clicks the "file" button, and the generated test case is the click of the "file" button.
For another example, the right click of the mouse on the corresponding trigger event keyword is a right click, and the format of the generated test case is X, where X is the right click object of the mouse.
For another example, a double click on the corresponding test object keyword by the mouse is a double click, and the format of the generated test case is a double click X, where X is the corresponding double click object.
For another example, the long-press of the mouse on the corresponding test object keyword is a long-press, and the format of the generated test case is a long-press X [ Y ], where X is the long-press object and Y is the long-press time, which are optional parameters. For example, the mouse presses the fast forward button for a long time, and the generated test case is the "fast forward" button 10s for a long time.
For another example, the test object keyword corresponding to the mouse sliding is the mouse sliding, the format of the generated test case is the mouse sliding to X [ stay Y ], Y is the long press time, and is an optional parameter. According to some embodiments, step S205 is executed to obtain an operation keyword corresponding to the trigger event according to a mapping relationship between the trigger event and the operation keyword, which is established in advance.
In step S207, a test object keyword corresponding to the test object is determined from the test object.
According to some example embodiments of the present application, before step S207 is executed, a mapping relationship between a trigger event and an operation keyword needs to be established, so that the same test object has a uniform name, which is convenient for a tester to identify the test object, and improves readability of a finally generated test case.
It should be noted that step S205 and step S207 have no execution sequence relationship, and the difference between the execution sequences of step S205 and step S207 does not affect the final result. In step S209, a test case is generated using the operation keyword and the test object keyword.
For example, the left mouse button clicks the "login" button, and the generated test case clicks the "login" button.
According to some example embodiments of the present application, the method shown in fig. 1 obtains an input device, such as a keyboard, a mouse, and a touch screen, to input data associated with a test object in addition to the test object and a trigger event. And generating a test case by using the operation keywords, the test object keywords and the related data input by the input equipment.
For example, a user Name TRun @ gr.la is input in a user Name input box with a Name attribute value of UserName, and a generated corresponding test case is "TRun @ gr.la" input in an "UserName" input box. The input user name can be a correct user name or an incorrect user name, so that the generated test case can verify various input possibilities of the user name input box.
For another example, in a Password input box with the Name attribute value of Password, the Password TRun @ gr.la is input, and the generated corresponding test case is "Password" input box, "TRun @ gr.la". The input password can be a correct password or an incorrect password, so that the generated test case can verify various input possibilities of the password input box.
For another example, a Login button with the Name attribute value of Login is clicked, and the generated corresponding test case is the click of the 'Login' button.
According to some embodiments, the test case generated in step S209 may be edited. For example, the generated test case can be modified in an editing mode for operation actions which cannot be automatically mapped directly through the input device.
For example, certain steps need to be performed before testing, such as waiting. Assuming that 10s of waiting is needed, the corresponding test case is added as waiting 10 s.
For another example, after clicking the login button, it is necessary to observe whether or not a dialog box appears. And if the login failure window needs to be observed, adding a corresponding test case to observe the prompt window with the login failure.
According to some embodiments, test cases are stored in a dictionary format,
the dictionary format is adopted to store the test cases, so that the computer can conveniently identify the generated test cases and execute automatic tests, the test cases can be conveniently formatted and output, and the reading of testers is facilitated.
For example, the dictionary of the stored test cases is:
{
in the "UserName" input box: the input "TRUN @ grr.la",
in the "passage" input box: the input "TRUN @ grr.la",
click on "Login" button: observe whether the login failure window appears
}。
According to some embodiments, after generating the test cases, the test cases are exported to facilitate manual testing, e.g., outputting the manual test cases in an Excel format or in an HTML format.
For example, the generated manual test case is a 'UserName' input box, where TRun @ grr.la is input; in the 'passage' input box, inputting 'TRUN @ grr.la'; clicking a 'Login' button to observe whether a Login failure window appears.
According to some embodiments, after generating the test cases, the test cases are exported to facilitate automated testing of the computer.
For example, the automation test case is output in XML format.
As another example, because the computer is able to recognize the dictionary format, the test cases in the dictionary format can be used directly for automated testing. In addition, the manual test case may be generated using a test case in a dictionary format.
According to some embodiments, the generated automated test case may be directly used to perform automated testing and generate an automated test report.
According to the embodiment shown in fig. 2, the test object and the trigger event are mapped to the predefined keyword, and the trigger event and the test object are used to generate the test case, so that the test case written manually can be replaced, and the automatic test case can be generated and the automatic test can be directly performed. The standardization of the manual test case is maintained, the complicated explanation and comparison process of the automatic test case and the manual test case is omitted, and the working efficiency of testing personnel is improved.
Fig. 3 is a block diagram of an apparatus for generating a test case according to an exemplary embodiment of the present application. As shown in fig. 3, an apparatus for generating a test case includes a trigger event obtaining module 301, a test object obtaining module 303, an operation keyword obtaining module 305, a test object keyword obtaining module 307, and a test case generating module 309, where the trigger event obtaining module 301 is configured to monitor a trigger event, the test object obtaining module 303 is configured to determine a test object corresponding to the trigger event, the operation keyword obtaining module 305 is configured to determine an operation keyword corresponding to the trigger event according to the trigger event, the test object keyword obtaining module 307 is configured to determine a test object keyword corresponding to the test object according to the test object, and the test case generating module 309 is configured to generate the test case by using the test object keyword and the operation keyword.
Fig. 4a shows a login box and fig. 4b shows a flow chart of a user operation performed using the login box shown in fig. 4 a.
A method for generating test cases according to an exemplary embodiment of the present application is described in detail below with reference to fig. 4a and 4b as an example.
The login box shown in fig. 4a includes a username entry box and password entry box, a login button and a close button. The Name attribute value of the user Name input box is UserName, the Name attribute value of the Password input box is Password, the Name attribute value of the Login button is Login, and the Name attribute value of the Close button is Close; the ClassType for the user name input box and password input is InputBox, and the ClassType for the login Button and the close Button is Button.
In step S401, when the mouse moves and clicks the user name input box, the system API is used to obtain the mouse click position, and the mouse operation object and the trigger event are determined according to the mouse position.
For example, a GDI + drawn interface and a test object without starting auxiliary automation test support in QT development firstly acquire the position information of a trigger event in a display interface
In step S403, when the user name TRun @ grr.la is input to the user name input box through the keyboard, the keyboard event is acquired through the system API, and the data input by the keyboard is acquired.
For example, the keyboard events corresponding to the Windows system include a keyboard press event (onkeydown) and a keyboard pop-up event (onkeyup), and the keyboard events are used to further acquire data input by the keyboard.
And generating a test case by using the attribute value of the user Name input box of the operation object, the operation action input and the input data of the keyboard, which are obtained in the steps S401 and S403, for example, determining that the operation object is an input box by using a class type attribute of the attribute value of the user Name input box, determining that the operation input box is a user Name input box by using a Name attribute, and generating the test case by using the data input by the keyboard, wherein TRun @ grr.
In step S405, when the mobile click password input box is input, the mouse click position is obtained by using the system API, and the mouse operation object and the trigger event are determined by the mouse position.
In step S407, when the password This @ test is input to the password input box through the keyboard, a keyboard event is acquired through the system API, and data input by the keyboard is acquired.
The test case is generated by using the attribute value of the operation object Password input box, the operation action "input" and the input data of the keyboard obtained in step S405 and step S407, for example, the operation object is determined as the input box by using the class type attribute of the Password input box, the operation input box is determined as the Password input box by using the Name attribute, and the test case is generated by using the data input by the keyboard, and This @ test is input in the "Password" input box.
In step S409, when the mouse moves to the Login button and clicks, the system API is used to obtain the mouse click position, and the mouse operation object is determined according to the mouse position.
The test case is generated by using the operation object Login button and the operation action "click" obtained in step S409, for example, the operation object is determined to be a button by using the ClassType attribute of the Login button, the operation button is determined to be a Login button by using the Name attribute of the Login button, and the generated test case is determined to be a click "Login" button according to the mouse operation action. If the Login failure window needs to be waited after the Login button is clicked, the generated test case can be modified by clicking the 'Login' button to observe whether the Login failure window appears.
Finally, the generated test cases are stored in a dictionary format,
for example, the generated test case is stored as:
{
in the "UserName" input box: the input "TRUN @ grr.la",
in the "passage" input box: the input "TRUN @ grr.la",
click on "Login" button: observe whether the login failure window appears
}。
And then, generating a corresponding automatic test case or manual test case according to the requirement of the automatic test or manual test.
Fig. 5 illustrates another apparatus for generating a test case according to an exemplary embodiment of the present application.
An apparatus 200 for generating test cases according to this embodiment of the present application is described below with reference to fig. 5. The apparatus 200 for generating test cases shown in fig. 5 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present application.
As shown in FIG. 5, the apparatus 200 for generating test cases is embodied in the form of a general purpose computing device. The components of the simulation apparatus 200 may include, but are not limited to: at least one processing unit 210, at least one memory unit 220, a bus 230 connecting different system components (including the memory unit 220 and the processing unit 210), a display unit 240, and the like.
Wherein the storage unit stores program code that can be executed by the processing unit 210 such that the processing unit 210 performs the methods according to various exemplary embodiments of the present application described herein. For example, the processing unit 210 may perform a method as shown in fig. 1.
The storage unit 220 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM)2201 and/or a cache memory unit 2202, and may further include a read only memory unit (ROM) 2203.
The storage unit 220 may also include a program/utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The simulation apparatus 200 may also communicate with one or more external devices 300 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the simulation apparatus 200, and/or with any devices (e.g., router, modem, etc.) that enable the simulation apparatus 200 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 250. Also, the simulation apparatus 200 can communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 260. The network adapter 260 may communicate with other modules of the simulation device 200 via the bus 230. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the simulation apparatus 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, and may also be implemented by software in combination with necessary hardware. The technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, or a network device, etc.) to execute the above method according to the embodiments of the present application.
The software product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In situations involving remote computing devices, the remote computing devices may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to external computing devices (e.g., through the internet using an internet service provider).
The computer readable medium carries one or more programs which, when executed by a device, cause the computer readable medium to perform the functions described above.
Those skilled in the art will appreciate that the modules described above may be distributed in the apparatus according to the description of the embodiments, or may be modified accordingly in one or more apparatuses unique from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
According to some example embodiments of the present application, by mapping the test object and the trigger event to the predefined keyword and generating the test case by using the trigger event and the test object, not only can the manually written test case be replaced, but also the automated test case can be generated and the automated test can be directly performed. The standardization of the manual test case is maintained, the complicated explanation and comparison process of the automatic test case and the manual test case is omitted, and the working efficiency of testing personnel is improved.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the description of the embodiments is only intended to facilitate the understanding of the methods and their core concepts of the present application. Meanwhile, a person skilled in the art should, according to the idea of the present application, change or modify the embodiments and applications of the present application based on the scope of the present application. In view of the above, the description should not be taken as limiting the application.
Claims (10)
1. A method for generating test cases, the method comprising:
monitoring a trigger event;
determining a test object corresponding to the trigger event;
determining an operation keyword corresponding to the trigger event according to the trigger event;
determining a test object keyword corresponding to the test object according to the test object;
and generating a test case by using the operation keywords and the test object keywords.
2. The method of claim 1, wherein determining the test object corresponding to the trigger event comprises:
and acquiring the test object by using an application interface provided by the operating system.
3. The method of claim 1, wherein determining the test object corresponding to the trigger event comprises: and acquiring the test object by utilizing the position information of the trigger event in a display interface.
4. The method of claim 1, wherein determining the test object corresponding to the trigger event comprises:
and determining a test object corresponding to the trigger event by utilizing the trigger position information of the trigger event in the display interface and the element layout mode of the display interface.
5. The method of claim 1, wherein:
the triggering event and the operation key words have a mapping relation established in advance; and/or
The test object and the test object keyword have a mapping relationship established in advance.
6. The method of claim 1, wherein prior to generating a test case using the operational key and the test object key, the method further comprises:
and acquiring data which is input by an input device and is associated with the test object.
7. The method of claim 5, wherein generating test cases using the operation keywords and the test object keywords comprises:
and generating a test case by using the operation keywords, the test object keywords and the data which is input by the input equipment and is related to the test object.
8. The method of claim 1, wherein after generating a test case using the operational key and the test object key, the method further comprises:
and executing an automatic test by using the test case, and generating a test report.
9. An apparatus for generating test cases, the apparatus comprising:
the trigger event acquisition module is used for monitoring trigger events;
the test object acquisition module is used for determining a test object corresponding to the trigger event;
an operation keyword acquisition module, configured to determine, according to the trigger event, an operation keyword corresponding to the trigger event;
the test object keyword acquisition module is used for determining a test object keyword corresponding to the test object according to the test object;
and the test case generating module is used for generating a test case by using the test object keywords and the operation keywords.
10. An apparatus for generating test cases, the apparatus comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111613318.3A CN114490330A (en) | 2021-12-27 | 2021-12-27 | Method and device for generating test case |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111613318.3A CN114490330A (en) | 2021-12-27 | 2021-12-27 | Method and device for generating test case |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114490330A true CN114490330A (en) | 2022-05-13 |
Family
ID=81495397
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111613318.3A Pending CN114490330A (en) | 2021-12-27 | 2021-12-27 | Method and device for generating test case |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114490330A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117827644A (en) * | 2023-12-04 | 2024-04-05 | 中国邮政储蓄银行股份有限公司 | Automated testing method and automated testing device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103049371A (en) * | 2012-11-07 | 2013-04-17 | 青岛海信传媒网络技术有限公司 | Testing method and testing device of Android application programs |
CN106874206A (en) * | 2017-02-27 | 2017-06-20 | 网易(杭州)网络有限公司 | Method, device and electronic equipment for cross-platform automatic test |
CN113392014A (en) * | 2021-06-23 | 2021-09-14 | 中国工商银行股份有限公司 | Test case generation method and device, electronic equipment and medium |
-
2021
- 2021-12-27 CN CN202111613318.3A patent/CN114490330A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103049371A (en) * | 2012-11-07 | 2013-04-17 | 青岛海信传媒网络技术有限公司 | Testing method and testing device of Android application programs |
CN106874206A (en) * | 2017-02-27 | 2017-06-20 | 网易(杭州)网络有限公司 | Method, device and electronic equipment for cross-platform automatic test |
CN113392014A (en) * | 2021-06-23 | 2021-09-14 | 中国工商银行股份有限公司 | Test case generation method and device, electronic equipment and medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117827644A (en) * | 2023-12-04 | 2024-04-05 | 中国邮政储蓄银行股份有限公司 | Automated testing method and automated testing device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108170611B (en) | Automated testing method and device, storage medium, electronic equipment | |
CN106844217B (en) | Method and device for embedding point of applied control and readable storage medium | |
US8490050B2 (en) | Automatic generation of user interfaces | |
US11074162B2 (en) | System and a method for automated script generation for application testing | |
CN111552633A (en) | Interface abnormal call testing method and device, computer equipment and storage medium | |
CN114253537B (en) | Form generation method and device, electronic device and storage medium | |
Grechanik et al. | Creating GUI testing tools using accessibility technologies | |
US20200050540A1 (en) | Interactive automation test | |
CN113836014B (en) | Interface testing method, device, electronic device and storage medium | |
CN106550038B (en) | A data configuration diagnosis system and method of a digital control system | |
CN111045653B (en) | System generation method and device, computer readable medium and electronic equipment | |
CN113051514B (en) | Element positioning method and device, electronic equipment and storage medium | |
CN115658529A (en) | Automatic testing method for user page and related equipment | |
CN113792138B (en) | Report generation method and device, electronic equipment and storage medium | |
CN112667517A (en) | Method, device, equipment and storage medium for acquiring automatic test script | |
CN116974929A (en) | Automatic test tool construction method, automatic test method and related equipment thereof | |
CN116955140A (en) | SDK test method, device, equipment and storage medium | |
CN114490330A (en) | Method and device for generating test case | |
WO2025161303A1 (en) | Browser-side web interface analysis method and apparatus | |
CN113220586A (en) | Automatic interface pressure test execution method, device and system | |
CN110347577B (en) | Page testing method, device and equipment thereof | |
CN113742240B (en) | User interface testing method, device, storage medium and electronic device | |
CN108885574B (en) | System for monitoring and reporting performance and correctness issues at design, compilation, and runtime | |
CN113377648A (en) | Software system diagnosis method and device, electronic equipment and computer readable medium | |
CN112905483A (en) | Automatic testing method and device based on webpage |
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 |