Test case conversion method and system

The automatic conversion of test cases from Excel to Word is achieved through wxpython+jinja2 technology, which solves the problems of low conversion efficiency and poor accuracy in the existing technology, improves conversion efficiency and quality, and simplifies the operation process.

CN119201116AInactive Publication Date: 2024-12-27INSPUR QILU SOFTWARE IND
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411245606.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology cannot efficiently and accurately convert Excel test cases into Word versions, resulting in data omissions, error entry, typography confusion and manual operation fatigue, affecting work efficiency and quality.

Method used

Using wxpython+jinja2 technology, field and title configuration is performed through the GUI interface, Word template code is automatically generated using the jinja2 engine, and openpyxl library is called for data processing, realizing the automatic conversion of Excel use cases to Word use cases.

Benefits of technology

It improves conversion efficiency, reduces error rate, simplifies operational processes, reduces labor costs, and improves the quality and consistency of testing work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201116A_ABST
    Figure CN119201116A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Excel testing, and particularly provides a test case conversion method and system, and the method and system are based on wxpython + jinja2, and comprise the following steps: S1, obtaining a test case of an original Excel version, and providing original test case data which are called Excel cases; s2, entering a'field configuration module 'on a GUI (Graphical User Interface) page; s3, entering a'title configuration module '; s4, outputting a template code main body statement and a use case code statement; s5, completing field configuration and title configuration; s6, generating backfill data of the Word template according to the title processing data configured in the step S3; and S7, calling jinja2 to backfill the data into the Word template, and storing the data in the selected directory. Compared with the prior art, the overall quality and level of testing work can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Excel testing technology and specifically provides a test case conversion method and system. Background Art

[0002] Due to different project delivery requirements, the test cases of the same product may need to be converted into different Word templates for delivery. The Excel version of the test case is easier to standardize and manage than the Word version. Since most test management software supports exporting the Excel version of the test case, it is often necessary to manually convert the Excel version of the test case into a Word version in a specific format. The main process of manually converting the Excel version of the test case into the Word version is as follows: 1) Manually organize the Word template information; 2) Manually copy the Excel data and put it into the corresponding Word template; 3) Adjust the Word version format and title content.

[0003] As software systems become increasingly complex and large, the number of test cases is also growing exponentially. In this process, problems such as data omission, incorrect entry, confusing typesetting, and incorrect font formatting are prone to occur. In addition, long-term repetitive manual operations can easily make testers feel tired and bored, which in turn affects work efficiency and quality. Moreover, due to the subjectivity and uncertainty of manual processing, the results of processing by different personnel may be different, which also brings difficulties to the management and evaluation of testing work. In summary, the existing manual processing method of test cases can no longer meet the growing testing needs, and a more efficient, accurate and automated test case conversion method is urgently needed. Summary of the invention

[0004] The present invention aims at solving the above-mentioned deficiencies of the prior art and provides a test case conversion method with strong practicability.

[0005] A further technical task of the present invention is to provide a test case conversion system that is reasonably designed, safe and applicable.

[0006] The technical solution adopted by the present invention to solve its technical problem is:

[0007] A test case conversion method based on wxpython+jinja2 has the following steps:

[0008] S1. Obtain the original Excel version of the test case and provide the original test case data, which is called the Excel test case;

[0009] S2. Enter the "Field Configuration Module" on the GUI page;

[0010] S3. Enter the "title configuration module";

[0011] S4, output template code main statements and use case code statements;

[0012] S5. Complete field configuration and title configuration;

[0013] S6. Process the data according to the title configured in step S3 to generate backfill data for the Word template;

[0014] S7. Call jinja2 to fill the data back into the Word template and save it to the selected directory.

[0015] Furthermore, in step S1, a custom Word test case template configured according to the rules is obtained to carry the converted test case and title data, which is called a Word template, to complete the data source acquisition.

[0016] Furthermore, in step S2, enter the "field configuration module" on the GUI page, select the fields required for the Word version according to the business fields in the Excel use case and save the configuration.

[0017] Furthermore, in step S3, enter the "title configuration module", configure the title according to the Word version template directory hierarchy and save it.

[0018] Furthermore, in step S4, the background automatically generates template code based on the existing title configuration, business field data and jinja2 statement rules, and outputs the template code body statements and use case code statements.

[0019] Furthermore, in step S5, after completing the field configuration and title configuration, select the Word template and Excel use case path and save directory, and then click "Save Data". The background data processing layer "Use Case Data Processing Module" calls the openpyxl library to read and preprocess the data according to the fields configured in step S2.

[0020] A test case conversion system obtains the original Excel version of the test case, provides the original test case data, called the Excel test case, enters the "field configuration module" on the GUI page, and after entering the "field configuration module", enters the "title configuration module", outputs the template code body statement and the test case code statement, completes the field configuration and title configuration, configures the title processing data, generates the backfill data of the Word template, calls jinja2 to backfill the data into the Word template, and saves it to the selected directory.

[0021] Furthermore, the original Excel version of the test case is obtained to provide the original test case data, which is called the "Excel test case"; the custom Word test case template configured according to the rules is obtained to carry the converted test case and title data, which is called the "Word template", and the data source acquisition is completed.

[0022] Further, enter the "Field Configuration Module" on the GUI page, select the fields required for the Word version according to the business fields in the Excel use case and save the configuration;

[0023] Enter the "Title Configuration Module", configure the title according to the Word version template directory hierarchy and save it.

[0024] Furthermore, the background automatically generates template code based on the existing title configuration, business field data and jinja2 statement rules, and outputs the template code body statements and use case code statements;

[0025] After completing the field configuration and title configuration, select the Word template and Excel use case path and save directory, and click "Save Data". The background data processing layer "Use Case Data Processing Module" calls the openpyxl library to read and preprocess data according to the configured fields.

[0026] Compared with the prior art, the test case conversion method and system of the present invention have the following outstanding beneficial effects:

[0027] The present invention applies the automation framework of jinja2 engine template to the test case writing and output, solves the problem that the traditional manual copying and outputting of test cases is cumbersome, time-consuming, error-prone, and formatted, and uses wxpython to develop a GUI interface, thereby visually optimizing the operation process, making the operation more concise and clear, and lowering the threshold for use. At the same time, only one Excel test case is needed to output various Word format test cases, and the use case conversion is more efficient, which reduces labor costs, improves work efficiency, reduces error rates, and improves the overall quality and level of testing work. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0029] Attached Figure 1 It is a structural diagram of a test case transformation method;

[0030] Attached Figure 2 It is a flowchart of a test case conversion method. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] A best embodiment is given below:

[0033] like Figure 1-2 As shown, a test case conversion method in this embodiment has the following steps:

[0034] S1. Obtain the original Excel version of the test case and provide the original test case data, which is called the Excel test case;

[0035] Get the custom Word test case template configured according to the rules to carry the converted test case and title data, called "Word template", to complete the data source acquisition.

[0036] S2. Enter the "Field Configuration Module" on the GUI page;

[0037] Select the fields required for the Word version (such as use case title, use case steps, etc.) according to the business fields in the Excel use case and save the configuration.

[0038] S3. Enter the "title configuration module";

[0039] Enter the "Title Configuration Module", configure the title according to the Word version template directory hierarchy (supports three-level title configuration) and save.

[0040] S4, output template code main statements and use case code statements;

[0041] The background automatically generates template code based on the existing title configuration, business field data and jinja2 statement rules, and outputs the template code body statements and use case code statements.

[0042] S5. Complete field configuration and title configuration;

[0043] After completing the field configuration and title configuration, select the Word template and Excel use case path and save directory, and click "Save Data". The background data processing layer "Use Case Data Processing Module" calls the openpyxl library to read and preprocess data according to the fields configured in step S2.

[0044] S6. Process the data according to the title configured in step S3 to generate backfill data for the Word template;

[0045] S7. Call jinja2 to fill the data back into the Word template and save it to the selected directory.

[0046] Based on the above method, a test case conversion system in this embodiment obtains the original Excel version of the test case, provides the original test case data, called the Excel test case, enters the "field configuration module" on the GUI page, and after entering the "field configuration module", enters the "title configuration module", outputs the template code body statement and the use case code statement, completes the field configuration and title configuration, configures the title processing data, generates the backfill data of the Word template, calls jinja2 to backfill the data into the Word template, and saves it to the selected directory.

[0047] Among them, the original Excel version of the test case is obtained to provide the original test case data, which is called the "Excel test case"; the custom Word test case template configured according to the rules is obtained to carry the converted test case and title data, which is called the "Word template", and the data source acquisition is completed.

[0048] Enter the "Field Configuration Module" on the GUI page, select the fields required for the Word version according to the business fields in the Excel use case and save the configuration;

[0049] Enter the "Title Configuration Module", configure the title according to the Word version template directory hierarchy and save it.

[0050] The background automatically generates template code based on the existing title configuration, business field data and jinja2 statement rules, and outputs the template code body statements and use case code statements;

[0051] After completing the field configuration and title configuration, select the Word template and Excel use case path and save directory, and click "Save Data". The background data processing layer "Use Case Data Processing Module" calls the openpyxl library to read and preprocess data according to the configured fields.

[0052] The above-mentioned specific implementations are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above-mentioned specific implementations. Any technical solutions that conform to the above-mentioned specific implementations of the present invention and any appropriate changes or substitutions made by ordinary technicians in the relevant technical field shall fall within the patent protection scope of the present invention.

[0053] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A test case conversion method, characterized in that: Based on wxpython+jinja2, the steps are as follows: S1. Obtain the original Excel version of the test case and provide the original test case data, which is called the Excel test case; S2. Enter the "Field Configuration Module" on the GUI page; S3. Enter the "title configuration module"; S4, output template code main statements and use case code statements; S5. Complete field configuration and title configuration; S6. Process the data according to the title configured in step S3 to generate backfill data for the Word template; S7. Call jinja2 to fill the data back into the Word template and save it to the selected directory.

2. A test case conversion method according to claim 1, characterized in that: In step S1, a custom Word test case template configured according to the rules is obtained to carry the converted test case and title data, which is called a Word template, to complete the data source acquisition.

3. A test case conversion method according to claim 2, characterized in that: In step S2, enter the "Field Configuration Module" on the GUI page, select the fields required for the Word version according to the business fields in the Excel use case, and save the configuration.

4. A test case conversion method according to claim 3, characterized in that: In step S3, enter the "Title Configuration Module", configure the title according to the Word version template directory hierarchy and save it.

5. A test case conversion method according to claim 4, characterized in that: In step S4, the background automatically generates template code based on the existing title configuration, business field data and jinja2 statement rules, and outputs the template code body statements and use case code statements.

6. A test case conversion method according to claim 4, characterized in that: In step S5, after completing the field configuration and title configuration, select the Word template and Excel use case path and save directory, and click "Save Data". The background data processing layer "Use Case Data Processing Module" calls the openpyxl library to read and preprocess data according to the fields configured in step S2.

7. A test case conversion system, characterized in that: Get the original Excel version of the test case, provide the original test case data, called the Excel test case, enter the "Field Configuration Module" on the GUI page, enter the "Field Configuration Module", and then enter the "Title Configuration Module", output the template code body statements and the test case code statements, complete the field configuration and title configuration, configure the title processing data, generate the backfill data of the Word template, call jinja2 to backfill the data into the Word template, and save it to the selected directory.

8. A test case conversion system according to claim 7, characterized in that: Get the original Excel version of the test case to provide the original test case data, called "Excel test case"; get the custom Word test case template configured according to the rules to carry the converted test case and title data, called "Word template", and complete the data source acquisition.

9. A test case conversion system according to claim 8, characterized in that: Enter the "Field Configuration Module" on the GUI page, select the fields required for the Word version according to the business fields in the Excel use case, and save the configuration; Enter the "Title Configuration Module", configure the title according to the Word version template directory hierarchy and save it.

10. A test case conversion system according to claim 9, characterized in that: The background automatically generates template code based on the existing title configuration, business field data and jinja2 statement rules, and outputs the template code body statements and use case code statements; After completing the field configuration and title configuration, select the Word template and Excel use case path and save directory, and click "Save Data". The background data processing layer "Use Case Data Processing Module" calls the openpyxl library to read and preprocess data according to the configured fields.

Citation Information

Cited By

  • Method for realizing stability test based on DIFF

    CN120196553A