如何使用COM4J在HP ALM中创建新的Testset?

时间:2014-07-10 14:29:49

标签: java alm com4j

我想使用Com4J在ALM中添加一个新的测试集。我尝试了以下代码:

ITestSetTreeManager treeManager = itd.testSetTreeManager().queryInterface(ITestSetTreeManager.class);
                ITestSetFolder testSetFolder = treeManager.nodeByPath("Root\\Training\\AutomationTest").queryInterface(ITestSetFolder.class);
                ITestSetFactory factory = testSetFolder.testSetFactory().queryInterface(ITestSetFactory.class);
                ITestSet testSet = factory.addItem(new Variant(Variant.Type.VT_NULL)).queryInterface(ITestSet.class);
                testSet.name("testSetName");
                testSet.status("Open");
                testSet.post();
                testSet.unLockObject();

使用上面的代码我在执行

时遇到异常
com4j.ComException: 8004051b (Unknown error) : Required field <Project Name> can not be empty or SPACE filled. : .\invoke.cpp:517
    at com4j.Wrapper.invoke(Wrapper.java:166)
    at $Proxy16.post(Unknown Source)
    at main.main.main(main.java:53)
Caused by: com4j.ComException: 8004051b (Unknown error) : Required field <Project Name> can not be empty or SPACE filled. : .\invoke.cpp:517
    at com4j.Native.invoke(Native Method)
    at com4j.StandardComMethod.invoke(StandardComMethod.java:42)
    at com4j.Wrapper$InvocationThunk.call(Wrapper.java:340)
    at com4j.Task.invoke(Task.java:51)
    at com4j.ComThread.run0(ComThread.java:153)
    at com4j.ComThread.run(ComThread.java:134)

0 个答案:

没有答案