Search code examples
c#hp-quality-centertest-plan

Retrieving details of Test object


After reading the folderstructure of QC Test Plan, I have read a list of Test by

TestFactory testFactory = (TestFactory)qcConnection.TestFactory;
TDFilter testFilter = (TDFilter)testFactory.Filter;

TDAPIOLELib.List testList;

folderPath = folderPath.Trim();
testFilter["TS_SUBJECT"] = "\"" + folderPath + "\"";

testList = (List) testFactory.NewList(testFilter.Text);

foreach (Test testItem in testList)
{
    //.... 
}

The above code works. I can read Test ID, Name, and some more simple fields.

As can be seen in this picture

qc test

There is a "description" page on the bottom of the "details" page.

How can I retrieve values from it? How can I reach those values?


Solution

  • The description text as per your diagram can be accessed using:

    myString = testItem("TS_DESCRIPTION")
    

    or

    myString = testItem.Field("TS_DESCRIPTION")
    

    The result is basically HTML of everything in that Description tab.