0

I am able to read the Test set and the tests in the set using OTA, but not able to get the object of Test Iteration in Test Lab.enter image description here

GlennV
  • 3,471
  • 4
  • 26
  • 39
ajit
  • 11
  • 4

1 Answers1

0

Add a Test Iteration in Test Lab->Test Set->Test Case->Test Instance Details->Execution Settings using QC OTA.

First, you need to find the Test Case object. It's TSTest object, which represents a test instance, or execution test, in a test set.

Then, you need to modify the value of TC_DATA_OBJ of this test instance.

For example,

  ITestSetTreeManager testSetTreeManager = (ITestSetTreeManager)tdConnection.TestSetTreeManager;
  TestSetFolder Root = (TestSetFolder)testSetTreeManager.Root;
  TestSetFolder labFolder;
  try
  {
    labFolder = (TestSetFolder)Root.FindChildNode("TestSetFolder");
  }
  catch (Exception e)
  {
    labFolder = null;
  }
  if (labFolder != null)
  {
    TestSetFactory testSetFactory = (TestSetFactory)labFolder.TestSetFactory;
    List testSetList = testSetFactory.NewList("");
    if (testSetList.Count > 0)
    {
      for (int testSetIndex = 1; testSetIndex <= testSetList.Count; testSetIndex++)
      {
        TestSet testSet = testSetList[testSetIndex];
        TSTestFactory tsTestFactory = (TSTestFactory)testSet.TSTestFactory;
        List tsTestList = tsTestFactory.NewList("");
        TSTest tsTest;
        for (int tsTestIndex = 1; tsTestIndex <= tsTestList.Count; tsTestIndex++)
        {
          tsTest = tsTestList[tsTestIndex];
          if (tsTest.Type == "BUSINESS-PROCESS")
          {
            string xml =
              "<DATAPACKET data_type=\"manual\"><CONFIGURATION><SELECTION first_sel_row=\"-1\" last_sel_row=\"-1\" /></CONFIGURATION><METADATA><COLUMNS>" +
              "<COLUMN column_name=\"p1\" column_value_type=\"String\" />" +
              "<COLUMN column_name=\"p2\" column_value_type=\"String\" />" +
              "<COLUMN column_name=\"p3\" column_value_type=\"String\" />" +
              "<COLUMN column_name=\"p4\" column_value_type=\"String\" /></COLUMNS></METADATA><ROWADATA>" +
              "<ROW col1=\"11\" col2=\"12\" col3=\"13\" col4=\"14\"/>" +
              "<ROW col1=\"21\" col2=\"22\" col3=\"23\" col4=\"24\"/>" +
              "<ROW col1=\"31\" col2=\"32\" col3=\"33\" col4=\"34\"/>" +
              "</ROWADATA></DATAPACKET>";
            tsTest["TC_DATA_OBJ"] = xml;
            tsTest.Post();         
          }
        }
      }
    }
  }

Note:

If you want to add a test iteration using QC OTA, you also need to keep the old values.

You just need to append a row in the below and input the value of each column. And others remain unchanged.

I hope my answer is helpful to you.

Thank you and regards,

Wenjuan