Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

How to set custom dropdown case field when using csv2testrail


#1

I am using csv2testrail.php to migrate test cases.

The custom filter used with csv2testrail has 9 custom fields (6 Text, 1 Date, 1 Steps and 1 Dropdown). We have no issue with the Text, Date and Steps fields, all of them are imported from the XML file (csv2testrail output) properly.

The Dropdown custom case field has a minor issue when importing into Testrail. Currently, we are manually adding the tag to the dropdown custom field in the XML file since we are not sure the issue is with csv2testrail or filter php file.

This dropdown custom case field (review_status) has 3 items.

In the custom filter file, we are using the following to assign the value from the csv file (the value is integer: 1, 2, 3)
$custom[‘review_status’] = $row[#]

In the output XML file, the corresponding line is <review_status>#</review_status>.

We need to change it <review_status>#</review_status> via texteditor, in order for the dropdown field value to be imported properly into Testrail.

How to resolve this issue? it seems csv2testrail.php is treating the ‘review_status’ field as Text field when using the default syntax listed above.

Thanks
John


#2

Hello John,

Thanks for your posting. You can simple use the following for this:

This will then generate the tag. I hope this helps and please let me know in case you have any further questions.

Regards,
Tobias


#3

Thanks. The tag is added properly.