Micro Focus QTP (UFT) Forums
How to fetch the QC path from QTP? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: How to fetch the QC path from QTP? (/Thread-How-to-fetch-the-QC-path-from-QTP)



How to fetch the QC path from QTP? - syedabu - 10-06-2008

Hi!!!
We have a piece of code that runs into the QC folder structure and fetch the input excel file from the location where we stored for all the tests and create a folder in my local path and then while QTP runs, it fetches the datas from the local path. I do not want to happen it in the existing way. Actually we are using the query to fetch the testname. Like the same way, i need to fetch the path name and store it for a later use.
could u pls help me out in this.
Following is the code which fetches the file and store it my local box.
IF possible please alter this code in such a way to import directly to my script.

Code:

Code:
TestName = "TerminalCreation"
Filename = GetAttachment(TestName)
Public Function GetAttachment(TestName)
Dim strTestName
strTestName=TestName
Set tdc=QCUtil.TDConnection
Set TstFact=tdc.TestFactory
Set TestList= TstFact.NewList("select TS_TEST_ID,TS_PATH from TEST where TS_NAME='"&strTestName&"'")
Set strTestName=TestList.Item(1)
Set AttFact=strTestName.Attachments
Set AttachList=AttFact.NewList("")
for each AttList in AttachList
    Longfilename=AttList.Name
    Set TestAttachStorage=AttList.AttachmentStorage
    TestAttachStorage.ClientPath="C:\Automation"
    AttList.Load True,"C:\Automation"
Next
GetAttachment=Longfilename
End Function


Thanks in Advance.....