The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP / Mercury TestDirector

Pages: 1
shrunks
Newbie


Reged: 08/31/12
Posts: 5
unable to delete test from test plan in qc usingVB
      #715754 - 09/03/12 02:21 AM

I am unable to delete the test from a test plan in QC using the following code. I dont know what is going worng but i am unable to proceed with this. Could somebody please help

Set objTestFactory = qc.TestFactory
Set objTestFilter = objTestFactory.Filter
SubjectPath = "Subject\Projects\Build Validation Tests\Test\"
objTestFilter.Filter("TS_SUBJECT") = "'" & SubjectPath & "'"
Set objTestList = objTestFactory.NewList(objTestFilter.Text)
For Each objTest In objTestList
If objTest.Filter("TS_NAME") = "test1" Then
TestID = objTest.Filter("TS_TEST_ID")
TestID.RemoveItem
MsgBox ("Deleted")
Exit Sub
Else
MsgBox ("Din got test case")
End If
Next


Post Extras: Print Post   Remind Me!   Notify Moderator  
Trudy
Advanced Member


Reged: 11/21/06
Posts: 524
Re: unable to delete test from test plan in qc usingVB [Re: shrunks]
      #715777 - 09/03/12 03:49 PM

Please tell us what version and patch level of QC you are using.

Is this the complete code? It doesn't appear to be. Can you post the complete code?

Are you getting any error message? If so, please post that information and identify which line is throwing the error.

I think your problem is in this area, but I don't have access to the documentation at this moment to find the correct syntax. I think you are not using the Filter method correctly.

If objTest.Filter("TS_NAME") = "test1" Then
TestID = objTest.Filter("TS_TEST_ID")

What are you trying to accomplish with the above lines of code?

--------------------
Trudy C
(Opinions and information contained in this post are wholly my own and do not reflect the opinions of my employer.)


Post Extras: Print Post   Remind Me!   Notify Moderator  
shrunks
Newbie


Reged: 08/31/12
Posts: 5
Re: unable to delete test from test plan in qc usingVB [Re: Trudy]
      #715790 - 09/03/12 10:09 PM

This was the complete code. Thanks for the response as
TestID = objTest.Filter("TS_TEST_ID") worked for me. I was not storing the value of the TestID correctly.

For Each objTest In objTestList
If objTest.Field("TS_NAME") = "test2" Then
TestID = objTest.Field("TS_TEST_ID")
objTestFactory.RemoveItem (TestID)
MsgBox ("Deleted")

is the actual working code. Thanks for the response


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 3 anonymous users are browsing this forum.

Moderator:  AJ, jgottlieb, corklad, bpolitzer 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 1886

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5