Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QC OTA Run Only one script and How to import DataTable during run time
#1
Not Solved
Hi All,

I have to write a VBscript that will run a particular testscript from testset (Test Lab) in QC. Also, I have to dynamically import a datasheet for the test in QC.

I implemented the first one.
It is running the whole testset instead of the ID i specified.
I have no idea how to import DataTable for a test that is run from QC TestLab.

Please Help me :'(
Reply
#2
Not Solved
Please try the below code
Code:
Public Function Func_DownloadAttachement_FromQC(pvt_QC_Folders_NodeName, pvt_LocalFolderPathWhereFileshaveTobeDownloaded)
Set tdc=TDUtil.TDConnection
Set gTreeManager = tdc.TreeManager
Set root=gTreeManager.TreeRoot("Subject")
set gSysTreeNode = gTreeManager.NodeByPath(pvt_QC_Folders_NodeName)
Set fact=gSysTreeNode.Attachments
Set alist = fact.NewList("")

'Find the right attachment and download it to the temp folder
For Each att In alist
Set ext = att.AttachmentStorage
attname = att.DirectLink   'other functionality att.id,  att.filename
Out_file_Name = Replace(attname, gSysTreeNode.NodeID,"")

    ext.Load attname, True
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set MyFile = fso.GetFile(ext.ClientPath & "\" & attname)
    MyFile.Copy ( pvt_LocalFolderPathWhereFileshaveTobeDownloaded & "\" & Out_file_Name)
    Set fso = Nothing
    Set MyFile = Nothing
    
Next
End Function
Reply
#3
Not Solved
Hi Ravi,

I tried to get the attachment associated with my testscript.
There is no attachment with the script.

I used the below code:

Code:
Set PlanTestFactory = QCConn.TestFactory
Set PlanTestFilter = PlanTestFactory.Filter
PlanTestFilter.Filter("TS_NAME") = "Google_Search"
PlanTestFilter.Filter("TS_SUBJECT") = Chr(34) & "Subject\Release11\QTP-Dummy" & Chr(34)
Set PlanTest = PlanTestFactory.NewList(PlanTestFilter.Text)
Set TSTObjToRun = PlanTest(1)
Set AttachmentObj = TSTObjToRun.Attachments
'----------------------------------------------------> It does not enter for loop
For Each attname In AttList
        attActName = attname.DirectLink
        MsgBox attActName
Next

Additional Information:
I saved the Test script in QC using SaveAs option in QTP.
In QC, i did not find any attachments for for the test script.
How do i import a new file during run time.

Also can you pls help me to execute only one script in a test set.
I have written code, but it is executiong the whole testset despite providing the id of the test instance.
Ex., Scheduler.Run ID
Reply
#4
Not Solved
Hi,

Please find the attachment for executing a particular test from QC.
test u want to execute , pass it under
qtp_test(0)= "VPP - Primary IP ADSL without BackUp Creation"
and for the next part of ur query to import the datasheet, u can create a function and call it in your test scripts that will load the datasheet from QC with respect to ur test case.

Hope this helps u.

regards,
Sankalp


Attached Files
.doc   Sub Test.doc (Size: 28 KB / Downloads: 208)
Reply
#5
Not Solved
Thanks You so much Shukla & Ravi

One more query:

I want to download the test results from QC or save it in local machine after run.
Is there anyway i can do that using OTA?


I have tried to save Results while saving QC with following Code:
But it did not work:

qtResultsOpt.ResultsLocation = "D:\ResultFolder\CP_Emp_CP" & RanNameVal

Thanks,
Guru
Reply
#6
Not Solved
Hi,

Instead of downloading the result u can create a txt file storing the result of each test case that u want to run( if this suits ur requirement)

Regards,
Sankalp
Reply
#7
Not Solved
Okay.. i want to download the result
If there is a way it will be really helpful
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Run Result Viewer-Standalone tool aeronmak 1 2,572 04-08-2014, 10:59 AM
Last Post: Ankur
  qtp run error nawres 5 4,537 12-07-2012, 07:52 PM
Last Post: elango87
  how to run multiple QTP scripts from QC on different remote machines urksp 1 6,267 09-07-2011, 03:20 PM
Last Post: rameshrise3
  when to use the command InvokeApplication and SystemUtil.Run srivaas.b 2 5,402 12-24-2010, 10:51 AM
Last Post: Shubhangi
Toungue Batch Run bfakruddin 1 3,104 11-02-2010, 09:33 PM
Last Post: sreekanth chilam

Forum Jump:


Users browsing this thread: 1 Guest(s)