Create an Excel file and pass the values from Flat File? (for ex:data1.txt,data2.txt )
Answer Posted / prashant puranik
'programme to transfer the data from notepad to excel
Dim fso,myfile,i,row
i=1,row=0
Set fso=Createobject("Scripting.filesystemobject")
Set myfile=fso.OpenTextFile("G:QTP Examplesqtpexamplefile2.txt",1,True)
Datatable.AddSheet("Puranik")
Datatable.GetSheet("Puranik").AddParameter "Prashant" ," "
Do While myfile.AtEndOfStream <> true
row=row+1
Datatable.GetSheet("Puranik").SetCurrentRow(row)
Datatable.Value("Prashant","Puranik")=myfile.ReadLine
Loop
Datatable.Export("G:QTP Examplesqtpexample_file1.xls")
'Programme to transfer the data from excel file to notepad
Dim fso,i,myfile
Datatable.AddSheet("mysheet")
Datatable.ImportSheet "G:QTP Examplesqtpexample_file2.xls","Sheet1","mysheet"
row=Datatable.GetSheet("mysheet").GetRowCount
Set fso=Createobject("Scripting.filesystemobject")
Set myfile=fso.OpenTextFile("G:QTP Examplesqtpexamplefile3.txt",2,True)
For i=1 to row
Datatable.GetSheet("mysheet").SetCurrentRow(i)
myfile.WriteLine(Datatable.Value("Anuj","mysheet"))
Next
Set myfile=nothing
Set fso=nothing
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is CMMP and CMMH?
What is QTP’s model for test creation?
What are test settings and global settings?
Suppose you are using shared objects repository in your test and you want to split your present action? At that time shared object repository is single or it’s also splits?
Differences between text and test area checkpoints?
Is text area check point supports for web applications?
How to use Environment parameterization? Explain with an example.
can i compare two databases using QTP ?
Object repositories types, which and when to use?
how to write xml output check point bu useing descriptive programing .means without useing output check point
Qtp has been installed on my pc but recently ON opening it is giving this error PLEASE REPLY IT IS URGENT IT WAS WORKKING FINE QTPRO.EX THE instruction at "0x7.. ...". referenced memory at "0000....The memory could not be read... Awaiting QTP XPERTS REPly URGENT
What is the syntax to call one action in another?
what is the diffrence bw qtp architectute and qtp framework?
I am trying to install QTP 9.5 but i am getting error message saying that ("Path is \QuickTest Professional\bin\vb_init.exe") vb_init.exe file is not find. can anybody give me the advise what to do ?
Can you brief the hurdles you faced during Automation testing?