Multi-line imports using csv

The release 1.6 is going to be unsupported by Community. Because our effort moves ahead. However there are still valuable informations for you.
Locked
bhargav
TestLink user
Posts: 1
Joined: Tue Feb 13, 2007 9:17 am

Multi-line imports using csv

Post by bhargav »

Is there a way by which I can import multi-line strings (for summary, steps, etc.) when importing test specification.
If yes can someone please show me a demo structure of that csv.
I am using Testlink 1.6.0.
Analyzer
TestLink user
Posts: 10
Joined: Wed Aug 30, 2006 7:28 am

Post by Analyzer »

Hi,

my first question, why you don´t use latest stable Version 1.6.3?

One way how to import:
Open excel document, make a header with component, category, Testcase, summary, step, result, keyword, keyword, keyword, key.......
Then fulfill the next rows with your expected data.
Finally use "save as" function and select "CSV (comma delimited);

please try this, if it will not work, please report it.

regards,
analyzer
LeeRenewData
Advanced user
Posts: 15
Joined: Fri Feb 09, 2007 11:34 pm
Location: Austin, TX

Post by LeeRenewData »

You can put carrage returns in your Excel files using Alt+Enter while editing a cell. We do this often for the Test Steps and Expected Results. You can save this Excel to csv with these embedded CRs just fine.
But they don't get converted properly on import into TestLink.

In version 1.6.3 of TestLink in file lib\functions\import.inc.php at the bottom is a function called stripQuotes. I is stripping out quotes from the imported csv file. I added additional lines to convert the CRs from the csv file to html line breaks <br> with these lines (I'll paste the whole function here but I can't garantee they will look right in the post);

function stripQuotes($data)
{
// strip out possible quotes at beginning and end of string
$data = preg_replace("/^['\"](.*?)['\"]$/","\\1", $data);
// Lee - replace carrage returns from Excel CSV (Alt+Enter) with <br>
// The WSIWYG TestLink editor actually uses <p> but that would be a little harder to implement
// \n = CR = chr(13) and LF = chr(10), we'll throw away CRs and convert LF's
$data = str_replace(chr(13),"", $data);
$data = str_replace(chr(10),"<br>", $data);
return $data;
}
Locked