Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Manipulate a manual run from QTP
#1
Not Solved
For performance and ease of maintenance I am trying to move away from executing test from Quality Center. I would still like to have results stored there.

1. I need to create a test case in QC - Done
2. create a test set
3. create instance of manual test in new test set
4. create a run, set the status of the steps (pass fail)
5. attach results.

I cant figure out how to do step 4.

I'm including I found that works for step 1 in case it helps anyone else.
Code:
Dim td 'As TDConnection
Dim DesignStpFactory 'As DesignStepFactory
Dim TestFactory 'As TestFactory
Dim Testobj 'As Test
Dim DesignStp 'As DesignStep
Dim TreeMgr 'As TreeManager

Set td = QCUtil.TDConnection
Set TestFactory = td.TestFactory

Set TreeMgr = td.TreeManager
Set folder = TreeMgr.NodeByPath("Subject\Development")
Set testFactory = folder.TestFactory
Set Testobj = testFactory.AddItem ("Run004")
Testobj.Post ()

Set DesignStpFactory = Testobj.DesignStepFactory
For i = 1 To 5
    Set DesignStp = DesignStpFactory.AddItem(Null)
    DesignStp.Field("DS_STEP_NAME") = "Step " & i
    DesignStp.Field("DS_DESCRIPTION") = "The design step description"
    DesignStp.Field("DS_EXPECTED") = "The expected"
    DesignStp.Post
Next

MsgBox "Created Test"


Sub Failure1

    Dim td 'As TDConnection
    Dim dsf 'As DesignStepFactory
    Dim tf 'As TestFactory
    Dim t 'As Test
    Dim ds 'As DesignStep
    Set td = QCUtil.TDConnection
    Set tf = td.TestFactory
    t = tf.AddItem("New Manual test")
    t.Post
    Set dsf = t.DesignStepFactory
    For i = 1 To 5
    Set ds = dsf.AddItem(Null)
    ds.Field("DS_STEP_NAME") = "Step " & i
    ds.Field("DS_DESCRIPTION") = "The design step description"
    ds.Field("DS_EXPECTED") = "The expected"
    ds.Post
    Next

end sub
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  manipulate cookies using scripts learnQtptips 1 2,192 09-27-2013, 07:26 AM
Last Post: basanth27
  How to manipulate Java JTree object in QTP jin.wang 1 6,694 05-20-2011, 07:41 PM
Last Post: perplexed

Forum Jump:


Users browsing this thread: 1 Guest(s)