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 copy a test from one folder to another
      #716060 - 09/07/12 01:33 AM

Unable to copy a test from one folder to another under test plan in qc with OTA. Somebody help on the same please

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


Reged: 11/21/06
Posts: 524
Re: Unable to copy a test from one folder to another [Re: shrunks]
      #716156 - 09/09/12 09:12 PM

Please provide a copy of your code. Are you running it from a workflow of from an external program? What version and patch level of QC are you using?

--------------------
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 copy a test from one folder to another [Re: Trudy]
      #716404 - 09/13/12 03:11 AM

Hi trudy, I have not yet reached to any particular logic. I was trying to copy the test case on clipboard and then paste it to desired location but it also did not worked. I am using QC 9.2. Pls do let me know if you get anything. I am still stucked with it

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


Reged: 08/31/12
Posts: 5
Re: Unable to copy a test from one folder to another [Re: shrunks]
      #716405 - 09/13/12 03:16 AM

Set objTestFactory = qc.TestFactory
Set objTestFilter = objTestFactory.Filter
SubjectPath = "Subject\Automation Assets\_Projects\Archana\Test1"
objTestFilter.Filter("TS_SUBJECT") = "'" & SubjectPath & "'"
Set objTestList = objTestFactory.NewList(objTestFilter.Text)
For Each objTest In objTestList
If objTest.Field("TS_NAME") = "Test1" Then
TestID = objTest.Field("TS_TEST_ID")
Set destTestFact = objTest.TestFactory
Set iscp = destTestFact
clipboard = iscp.CopyToClipBoard(TestID, 0, "")
MsgBox ("Copied")
Set objTestFilter1 = objTestFactory.Filter
SubjectPath1 = "Subject\Automation Assets\_Projects\Archana\Test Destination"
objTestFilter1.Filter("TS_SUBJECT") = "'" & SubjectPath1 & "'"
Set objTest1 = objTestFactory.NewList(objTestFilter1.Text)
TestID2 = objTest1.Field("NodeID")
iscp.PasteFromClipBoard clipboard, TestID2, 0, -1




I tried this but it did not worked


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


Reged: 11/21/06
Posts: 524
Re: Unable to copy a test from one folder to another [Re: shrunks]
      #718616 - 10/23/12 09:50 AM

In what way exactly is your code failing? Are you not getting the expected result? Are you getting an error message? Have you tried adding statements to confirm that you have legitimate values for things like TestID and TestID2?

There is a full example of how to do this in the OTA API Reference documentation under Interfaces > ISupportCopyPaste. Have you referred to that?

Are you trying to copy a single test or a folder of tests?

Below I have reformatted the code you posted with indenting to make it easier to read. It would seem that you didn't post all of your code, since it does not include an End statement for your IF, nor a Next statement for your FOR. Those omissions would cause problems with your code.



Code:

Set objTestFactory = qc.TestFactory
Set objTestFilter = objTestFactory.Filter
SubjectPath = "Subject\Automation Assets\_Projects\Archana\Test1"
objTestFilter.Filter("TS_SUBJECT") = "'" & SubjectPath & "'"
Set objTestList = objTestFactory.NewList(objTestFilter.Text)
For Each objTest In objTestList
If objTest.Field("TS_NAME") = "Test1" Then
TestID = objTest.Field("TS_TEST_ID")
Set destTestFact = objTest.TestFactory
Set iscp = destTestFact
clipboard = iscp.CopyToClipBoard(TestID, 0, "")
MsgBox ("Copied")
Set objTestFilter1 = objTestFactory.Filter
SubjectPath1 = "Subject\Automation Assets\_Projects\Archana\Test Destination"
objTestFilter1.Filter("TS_SUBJECT") = "'" & SubjectPath1 & "'"
Set objTest1 = objTestFactory.NewList(objTestFilter1.Text)
TestID2 = objTest1.Field("NodeID")
iscp.PasteFromClipBoard clipboard, TestID2, 0, -1





--------------------
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  
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: 2604

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5