10-06-2008, 02:57 PM
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:
Thanks in Advance.....
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.....