

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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/


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.