QC OTA:如何在测试实验室中添加测试迭代 - >测试集 - >测试用例 - >测试实例详细信息 - >使用QC OTA执行设置

时间:2015-10-28 22:47:34

标签: alm qc hp-quality-center

我能够使用OTA读取测试集和集合中的测试,但无法在测试实验室中获得测试迭代的对象。enter image description here

1 个答案:

答案 0 :(得分:0)

在测试实验室中添加测试迭代 - >测试集 - >测试用例 - >测试实例详细信息 - >使用QC OTA执行设置。

首先,您需要找到Test Case对象。它是TSTest对象,它代表测试集中的测试实例或执行测试。

然后,您需要修改此测试实例的TC_DATA_OBJ值。

例如,

  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();         
          }
        }
      }
    }
  }

注意:

如果要使用QC OTA添加测试迭代,还需要保留旧值。

您只需要在下面添加一行并输入每列的值。 其他人保持不变。

我希望我的回答对你有所帮助。

谢谢你,问候,

林文娟

相关问题