Micro Focus QTP (UFT) Forums
Reading from txt file on Quality Center - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Reading from txt file on Quality Center (/Thread-Reading-from-txt-file-on-Quality-Center)



Reading from txt file on Quality Center - stevol - 01-13-2009

Hi,
i have a problem about the txt file path. If i read file from my pc i have no problem, but now i want to put the script and the txt file on Quality Center. I have used a code like:

Code:
Dim fso, filer, type_id
Set fso  = CreateObject("Scripting.FileSystemObject")
Set filer= fso.OpenTextFile("[QualityCenter] Subject\TEST_AUTOMATICI_QTP\Registrazione_Sblocco_log\reg_input_preC1.txt",1)  '1=reading
type_id  = 2

'Lettura input per il type_id voluto
Do while filer.AtEndofStream <> True
   data = filer.ReadLine()
   If left(data,1)=cstr(type_id) Then
      arr=split(data,";")
   End If
Loop

but i obtain error about not found path. I proved to use both:
"Subject\TEST_AUTOMATICI_QTP\..."
"[QualityCenter] Subject\TEST_AUTOMATICI_QTP\..."
(obviously the txt file is really present on Quality Center :-) ).
Any idea?
Thanks in advance