|
请高人帮我看下代码,导入数据到测试用例的数据表时会出现错误
ITDConnection con;
if(0 != con.CreateDispatch("TDApiOle80.TDConnection.1"))
{
return;
}
//con.InitConnectionEx("");
//con.ConnectProject("ER", "admin", "");
ITestFactory TestFct = con.GetTestFactory();
VARIANT vItem;
vItem.vt = VT_NULL;
ITest tst = TestFct.AddItem(vItem);
tst.SetName("FC_Test14");
tst.SetType("MANUAL");
VARIANT v_sid;
v_sid.vt = VT_INT;
v_sid.intVal = 1010;
tst.SetField("TS_SUBJECT", v_sid);
VARIANT v_desc;
v_desc.vt = VT_BSTR;
v_desc.bstrVal = L"Helllo";
tst.SetField("TS_DESCRIPTION", v_desc);//Failure,cannot set the description field, the value of this field is still empty.
VARIANT v;
v.vt = VT_BSTR;
v.bstrVal = L"导入";
tst.SetField("TS_STATUS", v);//successed
VARIANT v3;
v3.vt = VT_BSTR;
v3.bstrVal = L"自定义字段";
tst.SetField("TS_USER_01", v3);//Failure,cannot set the field, the value of this field is still empty.
tst.Post();
不知道啥原因,"ts_staus”这个表中的状态字段可以导成功,但“TS_DESCRIPTION”用例的描述这个就失败,大家对qc二次开发时有碰到过吗。求解。谢谢。 |
|