【发布时间】:2015-10-28 22:47:33
【问题描述】:
我可以使用OTA读取测试集和测试集中的测试,但无法在测试实验室中获取测试迭代的对象。enter image description here
【问题讨论】:
标签: alm hp-quality-center
我可以使用OTA读取测试集和测试集中的测试,但无法在测试实验室中获取测试迭代的对象。enter image description here
【问题讨论】:
标签: alm hp-quality-center
在测试实验室中添加测试迭代->测试集->测试用例->测试实例详细信息->使用QC OTA执行设置。
首先,您需要找到测试用例对象。它是 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 添加测试迭代,您还需要保留旧值。
您只需要在下面追加一行并输入每列的值。 其他保持不变。
希望我的回答对你有帮助。
谢谢你和问候,
文娟
【讨论】: