|
|
| Line 3: |
Line 3: |
|
| |
|
| ==What's New!== | | ==What's New!== |
| {| border=1 cellpadding=4
| | csv2xml is now defunct as of Testopia 2.3. You can use the tr_importer.cgi to upload csv or xml directly from within a test plan (file -> import -> cases). |
| | 2006-11-21 ||
| |
| * Page created
| |
| |-
| |
| |}
| |
|
| |
|
| ==Getting Started==
| | see import_example.csv and testopia.xsd in the extensions/testopia directory for more details. |
| | |
| The script tr_csv2xml.pl is provided in your Bugzilla home directory to convert Testopia CSV files into Testopia XML files for import using tr_importxml.pl.
| |
| | |
| Usage is tr_csv2xml.pl [ -tcdb] input.csv output.xml.
| |
| | |
| The flag -tcdb is used for CSV derived from a propriety Test Case Database that had a few bugs in it's export format which included:
| |
| | |
| * Does not escape " used in a field with "". May use \" instead of "" but not always.
| |
| * Runs the CSV across multiple lines.
| |
| * In some cases a line may be missing the last field.
| |
| | |
| Most user's will not want to use the -tcdb flag.
| |
| | |
| ==CSV File Format==
| |
| | |
| The first line of the CSV should contain a list of columns in the file separated by commas.
| |
| | |
| For example: "Testcase Name","Attributes","Priority","Description","Folder","Creator","Owner","Pass/Fail Definition","Setup Steps","Cleanup Steps","Steps"
| |
| | |
| Each column header is converted to lower case, white space is removed and the '/'s are removed and the result is compared against the following values to determine how the field should be handled.
| |
| | |
| *author - see owner.
| |
| *attributes - comma seperated list used to create a tag.
| |
| *category - category for test case.
| |
| *cleanupsteps - added to Break Down section.
| |
| *component - component for test case.
| |
| *description - summary unless testcasename is defined. Added to Action section if -tcdb flag used.
| |
| *environment - split apart at each comma to become a tag.
| |
| *folder - only processed if -tcdb option is supplied. Split apart at each '/'. Based on each teams input one field becomes the category and others tags. Each team defines which sub folders they want to use and by default field 4 becomes the category and fields 5 and beyond are tags.
| |
| *longdescription - added to Action section if -tcdb flag used.
| |
| *owner (required) - in TCDB this is a ID that is mapped to a email address from the file tcdbUsers.
| |
| *passfaildefinition - added to Expected Results section.
| |
| *priority - becomes the priority. If just a number P is prepended.
| |
| *result - see passfaildefinition.
| |
| *resdetails - added to Action section if -tcdb flag used.
| |
| *setupsteps - added to Set Up section.
| |
| *steps - added to Action section.
| |
| *summary - see testcasename.
| |
| *tags - see attributes.
| |
| *testcasename - becomes the summary. if testcasename is not supplied the description is the summary. If testcasename and description are both null a error is generated. Added to Action section if -tcdb flag used.
| |
| | |
| Any columns other than those described above are ignored.
| |
| | |
| ==.work file==
| |
| | |
| The parser Class::CSV->parse() is passed a field list and needs a data file without header information. The .work file is created from the CSV supplied without the header line.
| |
| | |
| ==Extend Characters==
| |
| | |
| The parser Class::CSV->parse() does not accept extend characters and will error if extend characters are found. A subset of extend characters are converted to HTML entities when the .work file is created. Additional conversions for extend characters may need to be added at the top of the remvoe_field_list() method in tr_csv2xml.pl if you see the Failed to parse line error described in the Errors section.
| |
| | |
| ==Errors==
| |
| | |
| * Failed to parse line: "..." is a error from Class::CSV->parse() and could be cuase by extend characters. Save the error message into a file and use the Linux utility od -c to see if any extend characters are included in the file.
| |
| | |
| <br>Back to the [[Testopia |Testopia Main Page]]
| |