Help needed. Using JACOB with ALM OTA.

  • Lavneesh Chandna

    I have created a piece of code in vbscript through which I am able to create test scripts in ALM via OTA. Now I am trying to do the same thing through Java using JACOB as the Java 2 Com bridge and I have been able to create an empty test script using this, but I am not sure how to set the various field values.

    VBScript Code (That works perfectly):

               Set tdc = CreateObject("TDAPIOLE80.TDConnection")
               If (tdc Is Nothing) Then
                 MSGBOX "Connection is not created"
                MSGBOX "Connection is created"
               End If
               tdc.InitConnectionEx connectionString
               tdc.Login userName, password
               tdc.Connect domain, project
               Set TreeMgr = tdc.TreeManager
               Set testFolder = TreeMgr.NodeByPath(uploadDirectoryPath)
               Set testFactory = testFolder.TestFactory
               Set testItem = testFactory.AddItem (NULL)
               testItem.Field("TS_DESCRIPTION")="Test script description"

    Java code (Only that much that works)

         ActiveXComponent almConnection=new ActiveXComponent("TDAPIOLE80.TDConnection");, "InitConnectionEx", "conn string");      , "login", "uname","pword");, "connect","project","domain");    
        Dispatch treeMgr=Dispatch.get(almConnection, "TreeManager").toDispatch();
        Dispatch,"NodeByPath", "project path").toDispatch();
        Dispatch testFactory=Dispatch.get(testFolder, "TestFactory").toDispatch();             

    Now the issue is the last line in the VBScript code,

                testItem.Field("TS_DESCRIPTION")="Test script description"

    How do I code this in Java using JACOB? Please help. I have done a lot of google searching, but haven't found anything substantial.

  • BrianDrian

    BrianDrian - 2012-12-29

    Variant v = Dispatch.invoke(testItem,
    new Object {TS_DESCRIPTION, new Variant ("Any desription you need")},
    new int);

    jobs a good un.

  • BrianDrian

    BrianDrian - 2012-12-29

    TS_DESCRIPTION should be quoted



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks