0

I am trying to get list of testsets using JACOB- ALM connection. I am using below code to establish connection.

Dispatch.call(disp, "InitConnectionEx", "url");
Dispatch.call(disp, "Login", "user","password");
Dispatch.call(disp, "Connect", "Domain","Project");

Can someone suggest me code to connect to testlab and get the details from testset?

Abhishek Asthana
  • 1,857
  • 1
  • 31
  • 51
Sravan
  • 1
  • I can connect to Test plan using code Dispatch treeMgr=Dispatch.get(axc, "TreeManager").toDispatch(); Dispatch testFolder=Dispatch.call(treeMgr, "NodeByPath", "Path").toDispatch(); What is the test lab equivalent to test plan's "treeManager"? – Sravan Sep 05 '13 at 06:54

1 Answers1

0

What you need is the TestSetTreeManager. It has a method FindTestSets which gets you a list of test sets. Some example:

private static void printTestSetNamesFromFolder(String testLabPath)
{
    Dispatch treeManager = Dispatch.get(disp, "TestSetTreeManager").toDispatch();
    Dispatch testLabFolder = Dispatch.call(treeManager, "NodeByPath", testLabPath).toDispatch();
    Dispatch testSets = Dispatch.call(testLabFolder, "FindTestSets", "").getDispatch();
    EnumVariant testSetsList = new EnumVariant(testSets);

    while (testSetsList.hasMoreElements())
    {
        Dispatch testSet = testSetsList.nextElement().getDispatch();
        System.out.println(Dispatch.get(testSet, "Name").getString());
    }
}

I am new to Jacob, so I don't exactly know when to use get() or call() or toDispatch() or getDispatch() but the example should work fine.

Roland
  • 1,220
  • 1
  • 14
  • 29