UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21. Read more.
UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21.Read more.
Absent Member.. Absent Member..
Absent Member..
568 views

Updates to QC test parameters not reflecting

I am not able to update QC Test lab test parameters, though I am able to retrieve the existing value. I am also able to update the status of the testcase in Test lab. Updating the test parameter alone is the issue.       

 

  Below is a snippet of the code used.

 

    Dim tdc
    Dim runName
    Set tdc = CreateObject("TDAPIOLE80.TDConnection")
    Set ash = ThisWorkbook.Sheets(1)
    Row = 2
   
    tdc.InitConnectionEx "http://xxxx/qcbin/"
    tdc.Login "<userid>", "<password>"
    tdc.Connect "<Domain>", "<Project>"
    
      
    Set tfact = tdc.TestSetFactory
    Set tsTreeMgr = tdc.TestSetTreeManager
    Set tcTreeMgr = tdc.TreeManager
    npath = "Root\zz_PLEASE DELETE CONTENTS_zz"
    Set TestSetFolder = tsTreeMgr.NodeByPath(npath)
   
    Set TestSetF = TestSetFolder.TestSetFactory 'Retreive test from given folder in test lab
    On Error Resume Next
    Set aTestSetArray = TestSetF.NewList("")
    
    tsSet_cnt = aTestSetArray.Count
    Set tstests = aTestSetArray.Item(1)
    TestSet_Name = tstests.Name
    
   Set TestCaseF = tstests.TSTestFactory 'Retreive Test Cases from the test set
   Set aTestCaseArray = TestCaseF.NewList("")
   Set ts_obj = aTestCaseArray.Item(1)
   

   ts_obj.Status = "N/A" 'previous status was "incomplete"
   ts_obj.Post
   

   MsgBox ts_obj.Status 'displays "N/A"
   

   Set ParamRef = ts_obj.Params
   ParamRef.ParamValue("userid") = "111" 'previous value was "222"

   ts_obj.Params.Save
   ts_obj.Post
   MsgBox ParamRef.ParamValue("userid") 'displays 222 still. The new value did not reflect on the Test param

 

How can this issue be resolved? No errors are thrown as well.

0 Likes
3 Replies
Absent Member.. Absent Member..
Absent Member..

 

    Just replace where you have this
    Set tstests = aTestSetArray.Item(1)
    TestSet_Name = tstests.Name

 

for

 

     Set tstests = aTestSetArray.AddItem(Null)
     MyTest.Name = tstests.Name

 

 

See solution here http://www.qualitycenterstepbystep.com/2012/update-test-from-qtp/

 

Regards.

 

0 Likes
Absent Member.. Absent Member..
Absent Member..

    Just replace where you have this
    Set tstests = aTestSetArray.Item(1)
    TestSet_Name = tstests.Name

 

for

 

     Set tstests = aTestSetArray.AddItem(Null)
     TestSet_Name.Name = tstests.Name

 

 

See solution here http://www.qualitycenterstepbystep.com/2012/update-test-from-qtp/

0 Likes
Absent Member.. Absent Member..
Absent Member..

Thanks for the reply.

The change you have mentioned does not resolve my issue as you are talking about creating a new testset in Test lab whereas I use an existing testset. That would be the only difference due to the code change.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.