Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Read and write data to a file in QC within the QTP forums, part of the Software Testing category; How to read and write data to a file in QC using QTP Hi, How can we read a text file from QC using QTP. I need to read a ...
|
|||||||
|
|||
|
Read and write data to a file in QC
How to read and write data to a file in QC using QTP
Hi, How can we read a text file from QC using QTP. I need to read a text file saved in QC , process it and save a text file into QC with the results. How can I do that using QTP File System Object ? Thanks, Sai |
| Sponsored Links |
|
|||
|
Re: Read and write data to a file in QC
Function initialization()
dim fso, msg set fso = createobject("scripting.filesystemobject") if (fso.fileexists("c:\p_qtp.ini")) then fso.deletefile("c:\p_qtp.ini") end if set fso = nothing call qc_create_folder() if parameter("external_excel_flag")="true" then setdata "reportpath",parameter("datatablepath") setdata sexternal_excel,parameter("datatablepath") setdata ssheetname,parameter("sheetname") setdata bexternal_excel_flag,"true" else var2=split(sqcresults&"\"¶meter("qc_excelreportpath"),"\") var3=ubound(var2) reportfilename=var2(var3) var4="" n2=ubound(var2)-1 for n1=0 to n2 var4=var4&var2(n1)&"\" if n1=n2 then var5=len(var4) qcreportpath=left(var4,var5-1) end if next qc_importfile qcreportpath,reportfilename,getdata("files") setdata "reportpath",getdata("files")&reportfilename setdata "qcreportfilename",reportfilename setdata "qcreportpath",qcreportpath end if setdata "recovery","false" setdata "qc_defectlog",parameter("qc_defectlog") setdata "capture_screenshots",parameter("capture_screenshots") setdata "qc_uploadscreenshots",parameter("qc_uploadscreenshots") setdata "data_null","" end function Last edited by animesh.chatterjee; 01-16-2008 at 03:13 AM. |
|
|||
|
Re: Read and write data to a file in QC
Function QC_Create_Folder()
Dim fso, f,QCfolderpath Set fso = CreateObject("Scripting.FileSystemObject") QCfolderpath="C:\QC"&Month(Now)&day(now)&year(now)&Minute(time)&Second(Now) Set f = fso.CreateFolder(QCfolderpath) SetData "ParentFolder",QCfolderpath SetData "Files",QCfolderpath&"\Files\" SetData "ScreenshotPath",QCfolderpath&"\Screenshots\" CreateSubFolder QCfolderpath,"Files" CreateSubFolder QCfolderpath,"Screenshots" Set fso = nothing End Function |
|
|||
|
Re: Read and write data to a file in QC
In this way u need to initialize the folder ...make a download of the file targetted......edit....and upload the file ...
let me know if u need more help |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read a file by Servlet | Geek_Guest | JSP | 1 | 01-24-2008 05:18 AM |
| how we can read database file in C language? | kavi12_nc | C and C++ | 2 | 01-16-2008 02:13 AM |
| How to Unzip the file when there is only Read Permission | Geek_Guest | Unix/Linux | 1 | 08-03-2007 02:12 PM |
| How do you read and write to a serial port? | Geek_Guest | C# | 0 | 07-19-2007 02:15 AM |
| The Read/Write Web | Lokesh M | HTML & CSS | 0 | 06-21-2006 12:58 AM |