Test case generation method, device and system

CN115809190BActive Publication Date: 2026-06-19INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2022-08-31
Publication Date
2026-06-19

Smart Images

  • Figure CN115809190B_ABST
    Figure CN115809190B_ABST
Patent Text Reader

Abstract

This invention provides a test case generation method, apparatus, and system, applicable to the financial technology field or other technical fields. The test case generation method includes: receiving a QTP test script and a screenshot file from a client; recognizing image text information and graphic features in the screenshot file; combining the image text information and graphic features to generate image recognition content; and generating test cases based on the image recognition content and the QTP test script. This invention can quickly and accurately generate traceable test cases, improving the reusability of test case assets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of financial technology, and more specifically, to a test case generation method, apparatus, and system. Background Technology

[0002] The following issues exist in the current case testing:

[0003] 1. Generating test cases during the testing process requires significant human resources for design, review, and system entry. Test case designers need extensive experience and theoretical knowledge, a deep understanding of project modifications, and must perform tasks such as basic information gathering, process analysis, process path analysis, and test case management for the new modifications before test cases can be generated. This involves substantial resource investment, and the accuracy and coverage of the test cases are affected by factors such as the experience of the testers, increasing project risk.

[0004] 2. Standardizing test cases is difficult. In the past, test cases were designed and produced only for the current improvement points with limited time and energy. With the development of technology products, the linkage and interaction between products have gradually increased. Often, testers of a product line have limited knowledge of other related products. The communication cost among multiple products is high during the test case design process, making it impossible to achieve test cases with high universality and readability.

[0005] 3. The testing history is difficult to trace. After a program problem occurs in production, at this stage, it is only possible to determine whether the problem point has been tested by the quality of the test case design and the check record. It is impossible to scientifically and accurately trace the detailed testing process and results.

[0006] 4. Increased testing difficulty. Each version update includes significantly more changes than previous ones, leading to a year-on-year increase in the workload for testers in test case design and generation.

[0007] 5. UI designs that use many graphics and images to represent text cannot be independently converted into readable text by image recognition.

[0008] 6. Image recognition can recognize all the text in the entire image, but it cannot accurately locate the operation point to form operation steps.

[0009] There is currently no effective solution to the above problems. Summary of the Invention

[0010] The main objective of this invention is to provide a test case generation method, apparatus, and system to quickly and accurately generate traceable test cases and improve the reusability of test case assets.

[0011] To achieve the above objectives, embodiments of the present invention provide a test case generation method, including:

[0012] Receive QTP test scripts and screenshot files from the client;

[0013] Recognize image text information and graphic features in screenshot files;

[0014] Generate image recognition content by combining image text information and graphic features;

[0015] Test cases are generated based on the image recognition content and QTP test scripts.

[0016] In one embodiment, identifying graphic features in a screenshot file includes:

[0017] Identify visual features in screenshot files;

[0018] Visual features are mapped to prior features, and graphic features are obtained based on the mapping results.

[0019] In one embodiment, it further includes:

[0020] The test cases are compared with the cases in the case library, and the element values ​​are extracted based on the case comparison results.

[0021] Update cases in the case library based on feature values.

[0022] In one embodiment, generating test cases based on image recognition content and QTP test scripts includes:

[0023] The script comparison results are obtained by comparing the cases in the case library with the QTP test scripts.

[0024] When the script comparison results meet the preset conditions, test cases are generated based on the image recognition content and the QTP test script.

[0025] In one embodiment, generating test cases based on image recognition content and QTP test scripts includes:

[0026] The image recognition content and the QTP test script are associated based on the recognition time of the image recognition content and the test time of the QTP test script, and test cases are generated based on the association results.

[0027] This invention also provides a test case generation device, comprising:

[0028] The receiving module is used to receive QTP test scripts and screenshot files from the client;

[0029] The recognition module is used to recognize image text information and graphic features in screenshot files;

[0030] The module combines image and text information with graphic features to generate image recognition content.

[0031] The test case module is used to generate test cases based on image recognition content and QTP test scripts.

[0032] In one embodiment, the identification module includes:

[0033] A visual feature recognition unit is used to recognize visual features in screenshot files.

[0034] The graphic feature unit is used to map visual features to prior features and obtain the graphic features based on the mapping results.

[0035] In one embodiment, it further includes:

[0036] The case comparison module is used to compare test cases with cases in the case library and extract element values ​​based on the case comparison results.

[0037] The update module is used to update cases in the case library based on feature values.

[0038] In one embodiment, the test case module includes:

[0039] The script comparison unit is used to compare the cases in the case library with the QTP test scripts to obtain the script comparison results;

[0040] The test case unit is used to generate test cases based on the image recognition content and the QTP test script when the script comparison results meet the preset conditions.

[0041] In one embodiment, the test case unit is specifically used for:

[0042] The image recognition content and the QTP test script are associated based on the recognition time of the image recognition content and the test time of the QTP test script, and test cases are generated based on the association results.

[0043] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the test case generation method described above.

[0044] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the test case generation method described above.

[0045] This invention also provides a computer program product, including a computer program / instructions, wherein the computer program / instructions, when executed by a processor, implement the steps of the test case generation method described above.

[0046] This invention also provides a test case generation system, comprising:

[0047] The test case generation device as described above; and

[0048] The client is used to generate QTP test scripts and screenshot files, and upload the QTP test scripts and screenshot files to the test case generation device.

[0049] The test case generation method, apparatus, and system of this invention first identify image text information and graphic features in a screenshot file, then combine the image text information and graphic features to generate image recognition content, and finally generate traceable test cases quickly and accurately based on the image recognition content and QTP test scripts, thereby improving the reusability of test case assets. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is a flowchart of the test case generation method in an embodiment of the present invention;

[0052] Figure 2 This is a flowchart of a test case generation method in another embodiment of the present invention;

[0053] Figure 3 This is a structural block diagram of the test case generation device in an embodiment of the present invention;

[0054] Figure 4 This is a structural block diagram of the computer device in an embodiment of the present invention;

[0055] Figure 5 This is a schematic diagram of the test case generation system in an embodiment of the present invention. Detailed Implementation

[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0057] Those skilled in the art will recognize that embodiments of the present invention can be implemented as a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0058] It should be noted that the test case generation method, apparatus, and system of the present invention can be used in test case scenarios in the financial field, and can also be used in any field other than the financial field. The embodiments of the present invention do not limit the application field of the test case generation method, apparatus, and system.

[0059] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.

[0060] In view of the shortcomings of current test case testing, such as time-consuming processes and lack of traceability, this invention provides a test case generation method, device and system that records the manual testing process of testers, takes screenshots when clicked for image recognition, generates a test case library and automatically records the pass status of test cases. It can quickly and accurately generate traceable test cases based on image recognition content and QTP test scripts, thereby improving the reusability of test case assets.

[0061] The aforementioned product design process requires supporting tools such as Quick Test Professional (QTP) and Optical Character Recognition (OCR) technology, as well as user behavior recognition technology. In this invention, the business modeling results from the product model, process model, and entity model within the business architecture methodology serve as the business knowledge needed to generate case studies. The accuracy of image recognition is guaranteed by the technical algorithm methodology itself and is beyond the scope of this invention. The invention will be described in detail below with reference to the accompanying drawings.

[0062] Figure 1 This is a flowchart of the test case generation method in an embodiment of the present invention. Figure 2 This is a flowchart of a test case generation method in another embodiment of the present invention. For example... Figure 1 and Figure 2 As shown, the test case generation methods include:

[0063] S101: Receives QTP test scripts and screenshot files from the client.

[0064] Before executing S101, the client records basic information such as the logged-in user's basic information and the current test environment information, including browser type and version, network type (IPv4 / IPv6, carrier information), and local operating system. It also records screenshots of the user interface when the tester manually clicks and inputs confirmation actions. The client's QTP software synchronously records each operation step and the operated object, automatically generating QTP test script statements. QTP can also record environmental factors such as language type to form case elements. The image recognition of this invention is deployed on the server side; the client only needs to upload images, reducing the technical requirements for testers.

[0065] S102: Recognize image text information and graphic features in screenshot files.

[0066] To address the shortcomings of OCR in recognizing non-textual information (such as graphic features) during image recognition, and the existence of many graphic symbols in system or software interface designs that replace text, graphic features are identified by utilizing user behavior characteristics during system operation after the text information in the image is recognized, thus filling in the missing parts of the image recognition.

[0067] In practice, identifying graphic features in screenshot files includes:

[0068] Identify visual features in screenshot files, map the visual features to prior features, and obtain graphic features based on the mapping results.

[0069] For example, graphic features can be obtained based on a series of C3D feature extraction methods and the Weizmann prior database. C3D is used to extract visual features from continuously recorded images, recording all changes in the images, such as user mouse movements and input. Based on these behavioral characteristics, the user's actions are identified by mapping them to the Weizmann prior database information, thereby assisting in the recognition of image or graphic content that OCR text recognition cannot recognize.

[0070] The Weizmann prior database should include all categories and prior features of input device information that a computer can receive (e.g., keyboard input features, mouse clicks and scrolling, facial or ID card information input, etc.). For example, many systems often use "lock diagrams" instead of the word "password." OCR can only recognize "password" but not "lock diagrams," therefore it cannot recognize the information received by the system as "password input." In this case, the recognition of graphic features is used to supplement the information. For example, if the received input information is displayed in encrypted form on the image (e.g., ****** or ●●●), it can be recognized as "password operation behavior." The Weizmann prior database should be established according to the characteristics of the system being tested. For example, in a bank system, if the card number is used as the username input, the bank card BIN code feature should be used, and the number of digits should be between 16 and 19, which can help the system recognize it as "bank card number."

[0071] S103: Generate image recognition content by combining image text information and graphic features.

[0072] S104: Generate test cases based on image recognition content and QTP test scripts.

[0073] After executing S104, the following is also included:

[0074] The test cases are compared with the cases in the case library. The feature values ​​are extracted based on the comparison results, and the cases in the case library are updated based on the feature values.

[0075] In practice, when the test case is a duplicate or similar case to the case in the case library, the element values ​​are extracted to update the case in the case library, so as to make full use of and accumulate technological assets.

[0076] For example, the original case library contains Case A, "Customer Information Inquiry": Select the "Inquiry" function -> Select ID type: ID card -> Enter ID number -> Click "OK" -> Information returns customer number -> Click "Confirm" to return to the transaction page. Case B, in this case, involves selecting the "Inquiry" function -> Select ID type: Passport -> Enter ID number -> Click "OK" -> Information returns customer number -> Click "Confirm" to return to the transaction page. The steps are the same, but the options are different. Therefore, "ID type" is included as an element, merging the two cases into one. This new test case serves as the test asset archive case library.

[0077] In one embodiment, S104 includes:

[0078] The script comparison results are obtained by comparing the cases in the case library with the QTP test scripts.

[0079] When the script comparison results meet the preset conditions, test cases are generated based on the image recognition content and the QTP test script.

[0080] In practice, when the cases in the case library and the QTP test script are cases that cannot be merged and recombined, test cases are generated based on the image recognition content and the QTP test script.

[0081] In one embodiment, generating test cases based on image recognition content and QTP test scripts includes:

[0082] The image recognition content and the QTP test script are associated based on the recognition time of the image recognition content and the test time of the QTP test script, and test cases are generated based on the association results.

[0083] In practice, image recognition content and QTP test scripts can be associated one-to-one or one-to-many based on the recognition time of the image recognition content and the testing time of the QTP test script. Simultaneously, image recognition content without background response is deleted, considered an invalid operation. Finally, test cases are generated based on the association results, and the case generation time or case reuse time is recorded. The execution status (elements) of the cases is recorded during the operation. Cases stored in the case library serve as test assets, providing execution records for production event tracing and test optimization. The case creator and creation time are also noted; for duplicate cases, the execution time is recorded.

[0084] Figure 1 The test case generation method shown can be executed by a server. Figure 1 As shown in the process, the test case generation method of this embodiment first identifies the image text information and graphic features in the screenshot file, then combines the image text information and graphic features to generate image recognition content, and finally generates traceable test cases quickly and accurately based on the image recognition content and QTP test script, thereby improving the reusability of test case assets.

[0085] Based on the same inventive concept, this invention also provides a test case generation device. Since the principle of this device in solving the problem is similar to that of the test case generation method, the implementation of this device can refer to the implementation of the method, and the repeated parts will not be described again.

[0086] Figure 3 This is a structural block diagram of the test case generation device in an embodiment of the present invention. Figure 3 As shown, the test case generation device includes:

[0087] The receiving module is used to receive QTP test scripts and screenshot files from the client;

[0088] The recognition module is used to recognize image text information and graphic features in screenshot files;

[0089] The module combines image and text information with graphic features to generate image recognition content.

[0090] The test case module is used to generate test cases based on image recognition content and QTP test scripts.

[0091] In one embodiment, the identification module includes:

[0092] A visual feature recognition unit is used to recognize visual features in screenshot files.

[0093] The graphic feature unit is used to map visual features to prior features and obtain the graphic features based on the mapping results.

[0094] In one embodiment, it further includes:

[0095] The case comparison module is used to compare test cases with cases in the case library and extract element values ​​based on the case comparison results.

[0096] The update module is used to update cases in the case library based on feature values.

[0097] In one embodiment, the test case module includes:

[0098] The script comparison unit is used to compare the cases in the case library with the QTP test scripts to obtain the script comparison results;

[0099] The test case unit is used to generate test cases based on the image recognition content and the QTP test script when the script comparison results meet the preset conditions.

[0100] In one embodiment, the test case unit is specifically used for:

[0101] The image recognition content and the QTP test script are associated based on the recognition time of the image recognition content and the test time of the QTP test script, and test cases are generated based on the association results.

[0102] In summary, the test case generation device of this invention first identifies the image text information and graphic features in the screenshot file, then combines the image text information and graphic features to generate image recognition content, and finally generates traceable test cases quickly and accurately based on the image recognition content and QTP test script, thereby improving the reusability of test case assets.

[0103] This invention also provides a specific implementation of a computer device capable of implementing all the steps in the test case generation method described above. Figure 4 This is a structural block diagram of the computer device in an embodiment of the present invention, see below. Figure 4 The computer equipment specifically includes the following:

[0104] Processor 401 and memory 402.

[0105] The processor 401 is used to call the computer program in the memory 402. When the processor executes the computer program, it implements all the steps in the test case generation method in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:

[0106] Receive QTP test scripts and screenshot files from the client;

[0107] Recognize image text information and graphic features in screenshot files;

[0108] Generate image recognition content by combining image text information and graphic features;

[0109] Test cases are generated based on the image recognition content and QTP test scripts.

[0110] In summary, the computer device in this embodiment of the invention first identifies the image text information and graphic features in the screenshot file, then combines the image text information and graphic features to generate image recognition content, and finally generates traceable test cases quickly and accurately based on the image recognition content and QTP test scripts, thereby improving the reusability of test case assets.

[0111] This invention also provides a computer-readable storage medium capable of implementing all steps of the test case generation method in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the test case generation method in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:

[0112] Receive QTP test scripts and screenshot files from the client;

[0113] Recognize image text information and graphic features in screenshot files;

[0114] Generate image recognition content by combining image text information and graphic features;

[0115] Test cases are generated based on the image recognition content and QTP test scripts.

[0116] In summary, the computer-readable storage medium of this invention first identifies the image text information and graphic features in the screenshot file, then combines the image text information and graphic features to generate image recognition content, and finally generates traceable test cases quickly and accurately based on the image recognition content and QTP test scripts, thereby improving the reusability of test case assets.

[0117] This invention also provides a computer program product capable of implementing all steps of the test case generation method in the above embodiments. The computer program product includes a computer program / instructions that, when executed by a processor, implement all steps of the test case generation method in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:

[0118] Receive QTP test scripts and screenshot files from the client;

[0119] Recognize image text information and graphic features in screenshot files;

[0120] Generate image recognition content by combining image text information and graphic features;

[0121] Test cases are generated based on the image recognition content and QTP test scripts.

[0122] In summary, the computer program product of this invention first identifies the image text information and graphic features in the screenshot file, then combines the image text information and graphic features to generate image recognition content, and finally generates traceable test cases quickly and accurately based on the image recognition content and QTP test scripts, thereby improving the reusability of test case assets.

[0123] Based on the same inventive concept, this invention also provides a test case generation system. Since the principle of this system in solving the problem is similar to that of the test case generation method, the implementation of this system can refer to the implementation of the method, and the repeated parts will not be described again.

[0124] Figure 5 This is a schematic diagram of the test case generation system in an embodiment of the present invention. For example... Figure 5 As shown, the test case generation system includes:

[0125] The test case generation device as described above; and

[0126] The client is used to generate QTP test scripts and screenshot files, and upload the QTP test scripts and screenshot files to the test case generation device.

[0127] The specific process of the test case generation system in this embodiment of the invention is as follows:

[0128] 1. The client records basic information about the logged-in user and the current testing environment, such as browser type and version, network type (IPv4 / IPv6, ISP information), and local operating system. For example: Browser type: IE; Network: Wired network; ISP: ISP A.

[0129] 2. The client records screenshots of the user interface when testers manually click the mouse and input confirmation actions, including browser screenshots, input box screenshots, content screenshots, and submission interface screenshots.

[0130] 3. The client records each operation step, time point, and the object being operated on, for example:

[0131] 8:00:50 Receive network login system request, domain name / IP address XXXXX.com, MAC address XX.XX.XX>XX —> 8:01:01 System backend response 1 —> 8:01:11 System backend response 2 —> 8:01:17 System backend response 3 —> 8:01:30 Receive system page redirection request.

[0132] 4. The test case generation device receives QTP test scripts and screenshot files from the client.

[0133] 5. The test case generation device recognizes the image text information and graphic features in the screenshot file, and generates image recognition content by combining the image text information and graphic features.

[0134] For example, the screenshot file includes the name of the input box content (text or icon), and the "human shape", "lock shape" and "shield shape" are identified by C3D and the Weizmann prior database. Combined with the user's operation, the "username", "password" and "verification code" are identified.

[0135] 6. When the cases in the case library and the QTP test script are cases that cannot be merged and recombined, the test case generation device associates the image recognition content and the QTP test script according to the recognition time of the image recognition content and the test time of the QTP test script, and generates test cases based on the association result.

[0136] In practice, it is necessary to check for any unidentifiable elements that involve user behavior and only retain screenshots of images associated with the QTP backend.

[0137] For example, the QTP test script is as follows: System time 8:00:50 Browser enable signal -> 8:01:01 Username input box receives input information -> 8:01:10 Input content submission signal (end marker) -> 8:01:11 Password input box receives input signal -> 8:01:12 Input content submission signal (end marker) -> 8:01:17 Verification code input box receives input signal -> 8:01:25 Input content submission signal -> 8:01:30 Submit. At this time, the time corresponding to the username in the image recognition content should be between 8:01:01 and 8:01:10, the time corresponding to the password should be between 8:01:11 and 8:01:12, and the time corresponding to the verification code should be between 8:01:17 and 8:01:25.

[0138] The test case is as follows: Click the browser -> Click the username input box -> Click the password input box -> Click the verification code input box -> Click submit.

[0139] Based on the test cases, add element values ​​(such as browser type I, network environment type I, whether the input content is correct (yes / no), and whether the request was initiated (yes / no), etc.), and the final generated test cases are:

[0140] Network Environment (I, II, III) Click Browser (Browser Type I, II, III) -> Click Username Input Box (Does it meet the requirements) -> Click Password Input Box (Does it meet the requirements) -> Click Verification Code Input Box (Is it correct / meets the requirements) -> Click Submit (Is it successful?

[0141] 7. Compare the test cases with the cases in the case library. When the test cases are duplicates or similar to the cases in the case library, extract the feature values ​​to update the cases in the case library.

[0142] In summary, the test case generation system provided in this embodiment of the invention has the following beneficial effects:

[0143] (1) Image recognition is accurate and efficient, and information irrelevant to the operation is automatically filtered out;

[0144] (2) Automatically take screenshots based on the background response, without the need for manual upload to the server;

[0145] (3) The case generation speed is fast, and it can generate case tests with a unified format and steps;

[0146] (4) It is adaptable to a wide range of scenarios and can be universally applied to all functional tests of computer operating systems.

[0147] (5) The recognition content is accurate. It has a high recognition rate for both Chinese and foreign languages. It can accurately recognize text, tables and special formats, which greatly improves the accuracy of recognition and the reusability of test case assets.

[0148] (6) The service-oriented approach is convenient and fast. The image recognition and analysis module is deployed on the server side, which can support multi-threaded and large-volume access, which not only reduces the deployment complexity of the client side, but also improves the efficiency of recognition and analysis.

[0149] (7) Automatically record execution status, reduce the resource cost of manual screenshots, and form verifiable test records.

[0150] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

[0151] Those skilled in the art will also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention can be implemented by electronic hardware, computer software, or a combination of both. To clearly demonstrate the interchangeability of hardware and software, the functions of the various illustrative components, units, and steps described above have been generally described. Whether such functionality is implemented through hardware or software depends on the specific application and the overall system design requirements. Those skilled in the art can implement the described functions using various methods for each specific application, but such implementation should not be construed as exceeding the scope of protection of the embodiments of the present invention.

[0152] The various illustrative logic blocks, units, or devices described in the embodiments of this invention can be implemented or operate the described functions using a general-purpose processor, digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof. The general-purpose processor can be a microprocessor; alternatively, it can be any conventional processor, controller, microcontroller, or state machine. The processor can also be implemented using a combination of computing devices, such as a digital signal processor and a microprocessor, multiple microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.

[0153] The steps of the methods or algorithms described in the embodiments of this invention can be directly embedded in hardware, a software module executed by a processor, or a combination of both. The software module can be stored in RAM, flash memory, ROM, EPROM, EEPROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from and write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and storage medium can be housed in an ASIC, which can be housed in a user terminal. Optionally, the processor and storage medium can also be housed in different components of the user terminal.

[0154] In one or more exemplary designs, the functions described in the embodiments of the present invention can be implemented in hardware, software, firmware, or any combination of these three. If implemented in software, these functions can be stored on a computer-readable medium or transmitted on a computer-readable medium in the form of one or more instructions or code. Computer-readable media include computer storage media and communication media that facilitate the transfer of computer programs from one place to another. Storage media can be any available media that can be accessed by a general-purpose or special-purpose computer. For example, such computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store program code in the form of instructions or data structures and other forms that can be read by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Furthermore, any connection can be suitably defined as a computer-readable medium, for example, if the software is transmitted from a website, server or other remote resource via a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wirelessly, such as infrared, wireless and microwave, it is also included in the defined computer-readable medium. The disks and discs mentioned include compressed disks, laser discs, optical discs, DVDs, floppy disks, and Blu-ray discs. Disks typically copy data magnetically, while disks typically copy data optically using lasers. Combinations of the above can also be contained in computer-readable media.

Claims

1. A test case generation method characterized by, include: Receive QTP test scripts and screenshot files from the client; Identify image text information and graphic features in the screenshot file; Image recognition content is generated by combining the image text information and the graphic features; Test cases are generated based on the image recognition content and the QTP test script; The identification of graphic features in the screenshot file includes: Identify visual features in the screenshot file; wherein the visual features are used to record all change information in the screenshot file, and the change information includes at least the user's mouse movement and input; The visual features are mapped to prior features, and the graphic features are obtained based on the mapping results.

2. The test case generation method of claim 1, wherein, Also includes: The test cases are compared with cases in the case library, and the element values ​​are extracted based on the case comparison results. Update the cases in the case library based on the element values.

3. The test case generation method of claim 2, wherein, The test cases generated based on the image recognition content and the QTP test script include: The cases in the case library are compared with the QTP test scripts to obtain the script comparison results; When the script comparison result meets the preset conditions, a test case is generated based on the image recognition content and the QTP test script.

4. The test case generation method according to claim 3, characterized in that, The test cases generated based on the image recognition content and the QTP test script include: The image recognition content and the QTP test script are associated based on the recognition time of the image recognition content and the test time of the QTP test script, and test cases are generated based on the association results.

5. A test case generation apparatus characterized by comprising: include: The receiving module is used to receive QTP test scripts and screenshot files from the client; The recognition module is used to recognize the image text information and graphic features in the screenshot file; The module is used to combine the image text information and the graphic features to generate image recognition content; The test case module is used to generate test cases based on the image recognition content and the QTP test script; The identification of graphic features in the screenshot file includes: Identify visual features in the screenshot file; wherein the visual features are used to record all change information in the screenshot file, and the change information includes at least the user's mouse movement and input; The visual features are mapped to prior features, and the graphic features are obtained based on the mapping results.

6. A computer device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the test case generation method according to any one of claims 1 to 4.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the test case generation method according to any one of claims 1 to 4.

8. A computer program product comprising computer programs / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the test case generation method according to any one of claims 1 to 4.

9. A test case generation system characterized by, include: The test case generation apparatus according to claim 5; as well as The client is used to generate QTP test scripts and screenshot files, and upload the QTP test scripts and screenshot files to the test case generation device.