2

我想使用 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)
4

0 回答 0