ALM/QC OTA StepFactory

BrianDrian
2012-12-23
2013-05-20
  • BrianDrian
    BrianDrian
    2012-12-23

    Hi I am looking to convert the following VB scripting into jacab calls is there anywhere with some examples or could someone help with  the code?

      Set runStepF = CurrentRun.StepFactory
      Set lst = runStepF.NewList("")
      For Each Item In lst
          runStepF.RemoveItem(Item)
      Next

          Set qcStep = runStepF.AddItem(null)

           qcStep.Field("ST_STEP_NAME")= nameValue
           qcStep.Field("ST_DESCRIPTION")= descValue
           qcStep.Field("ST_EXPECTED") = expValue
           qcStep.Field("ST_STATUS") = statusValue
           qcStep.Field("ST_ACTUAL") = actValue
           qcStep.Post

           qcStep.Field("ST_EXECUTION_DATE") = dateValue
           qcStep.Field("ST_EXECUTION_TIME") = timeValue
           qcStep.Post

    CurrentRun.Status = "Passed"

     
  • BrianDrian
    BrianDrian
    2012-12-23

    sorry spelt jacob wrong and there no edit button

     
  • BrianDrian
    BrianDrian
    2012-12-23

    ActiveXComponent almConnection = new ActiveXComponent("TDAPIOLE80.TDConnection");
    Dispatch.call(almConnection, "InitConnectionEx", Url);
    Dispatch.call(almConnection, "login", username, "");
    Dispatch.call(almConnection, "connect", domain, project);

    Dispatch treeMgr     = Dispatch.get(almConnection, "TreeManager").toDispatch();
    Dispatch testFolder  = Dispatch.call(treeMgr, "NodeByPath", ProjectPath).toDispatch();
    Dispatch testFactory = Dispatch.get(testFolder, "TestFactory").toDispatch();
    Dispatch stepItem    = Dispatch.call (testFactory,"Item",testid).toDispatch();
    Variant v = Dispatch.invoke(stepItem,
                        "Field",
                        Dispatch.Put,
                        new Object {new Variant ("ST_STATUS"), new Variant("Failed")},
                        new int);

    I tried this but no success.  There is an exception "Invalid Field Name"