I've written a vb script to load test set data into QC using the the OTA API. The test set has a Description field (CY_COMMENT) defined as Memo. I cannot update this field with carriage return values in the data. I'd like to preserve the carriage returns but have had to remove them to get the vb script to work.
strRoot = "Root\Template Test Sets\Test\"
Dim objFileSystemObject Dim objfileSystem
Set objFileSystemObject = CreateObject("Scripting.FileSystemObject") If (objFileSystemObject Is Nothing) Then MsgBox ("Not able to create fso") End If
Set objFileSystem = objFileSystemObject.OpenTextFile("C:\Documents and Settings\Desktop\Scenarios.csv") If (objFileSystem Is Nothing) Then MsgBox ("Not able to open file") End If
If Not (objFileSystem Is Nothing) Then
Dim objTestSetTreeManager Dim objRootFolder Dim objTestSetFolder Dim objTestSetFolderFactory Dim objTestSetFactory Dim objTestSet Dim iCount Dim strText Dim strTestSetArray Dim strTestSet
Set objTestSetTreeManager = tdc.TestSetTreeManager
If Not (objTestSetTreeManager is nothing) then MsgBox ("objTestSetTreeManager created") Set objRootFolder = objTestSetTreeManager.NodeByPath(strRoot) If Not (objRootFolder is nothing) then MsgBox ("objRootFolder found - " & objRootFolder.Name) Set objTestSetFactory = tdc.TestSetFactory End If End If iCount = 0 Do Until objFileSystem.AtEndOfStream strText = objFileSystem.ReadLine MsgBox ("strtext = " & strText) strTestSetArray = split(strText,"~")
Re: Using OTA API to update Quality Center test sets
We've put both CR and LF fields into some QC fields with our plugin and it's worked ok - but I don't think we use them in our formatting of the CY_COMMENT field, so I can't say for sure it would work.
One thing we've found is that it's best to only use them where really necessary - the 0x10 and 0x13 chars can get fiddly in SQL statements for db admins who run conversion or other SQL jobs on the DB
And ... there is an alternative for fileds like CY_COMMENT. These fields can take HTML formatting, so you can use strings like to insert line breaks. You can also use wrappers etc to pretty up the text with bold, underline etc.