CN111045917A - Method and device for converting format of test case - Google Patents

Method and device for converting format of test case Download PDF

Info

Publication number
CN111045917A
CN111045917A CN201811195237.4A CN201811195237A CN111045917A CN 111045917 A CN111045917 A CN 111045917A CN 201811195237 A CN201811195237 A CN 201811195237A CN 111045917 A CN111045917 A CN 111045917A
Authority
CN
China
Prior art keywords
test
case
file
format conversion
template
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
Application number
CN201811195237.4A
Other languages
Chinese (zh)
Inventor
韩春燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongjun New Energy Co ltd
Original Assignee
Hanergy Mobile Energy Holdings Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hanergy Mobile Energy Holdings Group Co Ltd filed Critical Hanergy Mobile Energy Holdings Group Co Ltd
Priority to CN201811195237.4A priority Critical patent/CN111045917A/en
Publication of CN111045917A publication Critical patent/CN111045917A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

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 invention provides a method and a device for converting a test case format, which relate to the field of software testing, wherein the method comprises a loading step of loading a test case file and converting the test case file into an XML file; analyzing, namely analyzing the XML file to obtain the hierarchical relationship between the test nodes and the test nodes; and a format conversion step, namely converting the test node and the hierarchical relation into a tree structure file, and importing the tree structure file into a target case template to complete the format conversion of the test case. The automation of test case conversion is realized, the working efficiency is improved, and the labor and time cost is reduced.

Description

Method and device for converting format of test case
Technical Field
The invention relates to the technical field of software testing, in particular to a method and a device for converting a test case format.
Background
In the field of software testing at present, most companies design case templates according to personal preferences, save the case templates through Excel, Word and other document tools, and manually modify the templates and formats of the test cases when the test cases are imported into the test software, so that the test cases become the templates and format import required by the test management software (for example, Chandao open source 9.4 only allows the csv format), thereby leading to 1. the design of the test cases lacks a uniform and standard format; 2. different test case templates can be loaded by different test management software.
Disclosure of Invention
Therefore, aiming at the technical defects, the invention aims to realize the automatic conversion of the test case template and the format and improve the test efficiency by using the method and the device for converting the test case format.
In order to achieve the purpose, the technical scheme adopted by the invention comprises the following steps:
a method for test case format conversion, comprising:
loading, namely loading a test case file and converting the test case file into an XML file;
analyzing, namely analyzing the XML file to obtain the hierarchical relationship between the test nodes and the test nodes;
and a format conversion step, namely converting the test node and the hierarchical relation into a tree structure file, and importing the tree structure file into a target case template to complete the format conversion of the test case.
The format conversion step further comprises storing the tree structure file in a structured database.
The format conversion step also comprises the step of importing the tree structure file into the target use case template from the structured database.
And if the target use case template does not exist, newly building the target use case template, and querying and extracting the newly built target use case template through an SQL statement.
The target case template is a case format template suitable for a software test management tool.
The invention also provides a device for converting the format of the test case, which comprises the following components:
the loading module is used for loading the test case file and converting the test case file into an XML file;
the analysis module is used for analyzing the XML file to obtain the hierarchical relationship between the test nodes;
and the format conversion module is used for converting the test node and the hierarchical relation into a tree structure file, importing the tree structure file into a target case template, and completing the format conversion of the test case.
The format conversion module also stores the tree structure file into a structured database.
The format conversion device also comprises a function of importing the tree structure file into the target use case template from the structured database.
And if the target use case template does not exist, newly building the target use case template, and querying and extracting the newly built target use case template through an SQL statement.
The target case template is a case format template suitable for a software test management tool.
The technical effects of the invention are as follows:
the invention utilizes the analysis of the semi-structured document based on the XML method to create a test case set and a test case obtained by a tree structure file, and the test case set and the test case are exported according to a case template and a format required by target management software; the automation of test case conversion is realized, the working efficiency is improved, and the labor and time cost is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of test case import, analysis, and storage;
FIG. 2 is a flow chart of test case conversion format;
FIG. 3 is a view showing the structure of the apparatus of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following is inventive example 1, as shown in figures 1 and 2:
the invention provides a method for converting a test case format, which comprises the following steps:
loading, namely loading a test case file and converting the test case file into an XML file;
analyzing, namely analyzing the XML file to obtain the hierarchical relationship between the test nodes and the test nodes;
and a format conversion step, namely converting the test node and the hierarchical relation into a tree structure file, and importing the tree structure file into a target case template to complete the format conversion of the test case.
The format conversion step further comprises storing the tree structure file in a structured database.
The format conversion step also comprises the step of importing the tree structure file into the target use case template from the structured database.
And if the target use case template does not exist, newly building the target use case template, and querying and extracting the newly built target use case template through an SQL statement.
The target case template is a case format template suitable for a software test management tool.
The following is inventive example 2, shown in fig. 3:
the invention also provides a device for converting the format of the test case, which comprises the following components:
the loading module is used for loading the test case file and converting the test case file into an XML file;
the analysis module is used for analyzing the XML file to obtain the hierarchical relationship between the test nodes;
and the format conversion module is used for converting the test node and the hierarchical relation into a tree structure file, importing the tree structure file into a target case template, and completing the format conversion of the test case.
The format conversion module also stores the tree structure file into a structured database.
The format conversion device also comprises a function of importing the tree structure file into the target use case template from the structured database.
And if the target use case template does not exist, newly building the target use case template, and querying and extracting the newly built target use case template through an SQL statement.
The target case template is a case format template suitable for a software test management tool.
The following is inventive example 3, shown below:
loading and importing test cases (in formats of xls, xlsx and the like) to be converted for analysis;
analyzing the test case based on an XML document to obtain a test node and a node hierarchical relation, and converting the test node and the node hierarchical relation into a tree structure file; analyzing the tree structure file to obtain a test case set and a test case, and storing the test case set and the test case set into a structured database;
exporting a test case, firstly, a data table is newly built, and if a target case template exists, loading can be selected; and if no target template exists, establishing a template, then inquiring and extracting the template through an SQL statement to form a newly established test case set and a test case, and finally exporting the test case suitable for the target test management software format.

Claims (10)

1. A method for test case format conversion, comprising:
loading, namely loading a test case file and converting the test case file into an XML file;
analyzing, namely analyzing the XML file to obtain the hierarchical relationship between the test nodes and the test nodes;
and a format conversion step, namely converting the test node and the hierarchical relation into a tree structure file, and importing the tree structure file into a target case template to complete the format conversion of the test case.
2. The method of test case format conversion of claim 1, wherein the format conversion step further comprises storing the tree structure file in a structured database.
3. The method of test case format conversion of claim 2, wherein the format conversion step further comprises importing the tree structured file from the structured database to the target use case template.
4. The method according to claim 3, wherein if there is no target use case template, then creating a target use case template, and extracting the created target use case template through SQL statement query.
5. The method for test case format conversion according to claim 4, wherein the target case template is a case format template suitable for a software test management tool.
6. An apparatus for test case format conversion, comprising:
the loading module is used for loading the test case file and converting the test case file into an XML file;
the analysis module is used for analyzing the XML file to obtain the hierarchical relationship between the test nodes;
and the format conversion module is used for converting the test node and the hierarchical relation into a tree structure file, importing the tree structure file into a target case template, and completing the format conversion of the test case.
7. The apparatus for test case format conversion of claim 6, the format conversion module further comprising storing the tree structure file in a structured database.
8. The apparatus for test case format conversion of claim 7, wherein the format conversion apparatus further comprises importing the tree structured file from the structured database to the target use case template.
9. The apparatus for test case format conversion according to claim 8, wherein if there is no target use case template, a target use case template is created, and the created target use case template is extracted by SQL statement query.
10. The apparatus for test case format conversion according to claim 9, wherein the target case template is a case format template adapted for a software test management tool.
CN201811195237.4A 2018-10-12 2018-10-12 Method and device for converting format of test case Pending CN111045917A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811195237.4A CN111045917A (en) 2018-10-12 2018-10-12 Method and device for converting format of test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811195237.4A CN111045917A (en) 2018-10-12 2018-10-12 Method and device for converting format of test case

Publications (1)

Publication Number Publication Date
CN111045917A true CN111045917A (en) 2020-04-21

Family

ID=70230277

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811195237.4A Pending CN111045917A (en) 2018-10-12 2018-10-12 Method and device for converting format of test case

Country Status (1)

Country Link
CN (1) CN111045917A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468003A (en) * 2021-06-18 2021-10-01 上海芷锐电子科技有限公司 Tree-shaped display and operation system and method for chip test data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030121025A1 (en) * 2001-09-05 2003-06-26 Eitan Farchi Method and system for combining multiple software test generators
CN103544107A (en) * 2013-11-01 2014-01-29 深圳市通力科技开发有限公司 Method and device for generating test case document
CN105068929A (en) * 2015-08-06 2015-11-18 网易(杭州)网络有限公司 Test script generation method, test script generation device, testing method, testing device and testing system
CN105893254A (en) * 2016-03-29 2016-08-24 乐视控股(北京)有限公司 Test case input method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030121025A1 (en) * 2001-09-05 2003-06-26 Eitan Farchi Method and system for combining multiple software test generators
CN103544107A (en) * 2013-11-01 2014-01-29 深圳市通力科技开发有限公司 Method and device for generating test case document
CN105068929A (en) * 2015-08-06 2015-11-18 网易(杭州)网络有限公司 Test script generation method, test script generation device, testing method, testing device and testing system
CN105893254A (en) * 2016-03-29 2016-08-24 乐视控股(北京)有限公司 Test case input method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468003A (en) * 2021-06-18 2021-10-01 上海芷锐电子科技有限公司 Tree-shaped display and operation system and method for chip test data
CN113468003B (en) * 2021-06-18 2023-06-02 上海芷锐电子科技有限公司 Tree-shaped display and operation system and method for chip test data

Similar Documents

Publication Publication Date Title
CN104077665B (en) Electricity power engineering analysis of prices data gathering system and method
CN109582647B (en) Unstructured evidence file oriented analysis method and system
CN106844307B (en) System and method for converting Excel into Word based on mark
CN109254907B (en) Java-based interface test report generation method and system
CN102043719B (en) Method for testing IEC61850 configuration description file
CN104035754A (en) XML (Extensible Markup Language)-based custom code generation method and generator
CN107506383B (en) Audit data processing method and computer equipment
CN101859303A (en) Metadata management method and management system
CN110543621B (en) Multi-format result document analysis system of aviation detection equipment and use method thereof
CN107168695B (en) Excel data analysis method and system
CN108874985B (en) Distributed analysis configuration method for SCD (substation configuration description) file of intelligent substation
CN103077093A (en) Substation configuration description (SCD) calibration method based on model objectification semantics
CN114968214B (en) Code automatic generation method and device, storage medium and terminal equipment
CN110851511A (en) Data synchronization method and device
CN112231407A (en) DDL synchronization method, device, equipment and medium of PostgreSQL database
CN106570095B (en) XML data operation method and equipment
CN111045917A (en) Method and device for converting format of test case
CN114253995A (en) Data tracing method, device, equipment and computer readable storage medium
CN109062816A (en) A kind of method, device and equipment of software test
CN109086985B (en) Professional test information management system for spacecraft assembly
CN108399196B (en) Automatic sql execution method and system of database sql statement automatic generation tool
CN107506339B (en) Character offset-based SCD node verification error positioning method and device
CN115757174A (en) Database difference detection method and device
CN115757479A (en) Database query optimization method, machine-readable storage medium and computer device
CN107861725B (en) iOS data reverse automatic analysis strategy

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201230

Address after: 101400 Yanqi Street, Yanqi Economic Development Zone, Huairou District, Beijing

Applicant after: Beijing Huihong Technology Co.,Ltd.

Address before: Room 107, building 2, comprehensive office area, Olympic Village street, Chaoyang District, Beijing

Applicant before: HANERGY MOBILE ENERGY HOLDING GROUP Co.,Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20211027

Address after: No.31 Yanqi street, Yanqi Economic Development Zone, Huairou District, Beijing

Applicant after: Dongjun new energy Co.,Ltd.

Address before: 101400 Yanqi Street, Yanqi Economic Development Zone, Huairou District, Beijing

Applicant before: Beijing Huihong Technology Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200421