Answer Posted / sreeprasad
File System is used to create file through scripting.We can
read, write and save data in txt file and use it after
wards during testing. Here is example of creating txt file
through FSO
Const ForReading = 1, ForWriting = 2
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("c:testfile.txt",
ForWriting, True)
MyFile.WriteLine "Hello world!"
MyFile.WriteLine "The quick brown fox"
MyFile.Close
Set MyFile = fso.OpenTextFile("c:testfile.txt",
ForReading)
ReadLineTextFile = MyFile.ReadLine ' Returns "Hello
world!"
It will create testfile.txt and enter "This is a test" in
that text file. You can later read that line "This is a
test" from this file while using
MyFile.ReadLine
We can save variables data during testing and then use that
data in future instances of testing and then delete that
file.
Is This Answer Correct ? | 19 Yes | 3 No |
Post New Answer View All Answers
how to write the descriptive programming in QTP for remove the object value and substitute, with a variable then call the validation from excel
How to read a text file from QC using QTP. I would like to do something like this. But instead read a file from QC and NOT from my local drive. Set fso = CreateObject("Scripting.FileSystemObject") Set InputFile = fso.OpenTextFile("C:\test.txt", ForReading) Thanks
Write a QTP script to enter a keyword in to Google search engine?
How you debug your script?
What do you mean by iteration?
What is optional step in qtp? How you can add optional step in qtp?
Which HTML specification will be adhered to? How strictly? What variations will be allowed for targeted browsers?
Is QTP supports Unix. If yes, then how the test automation is done?
How to capture all the data of a webtable, weblist and combolist using QTP?
Hi,All How to create a link in excel sheet using qtp
What is QTP scenario.
Hi frens! I am testing VB project with MS Access database. At add button click my record is storing in data table and it is shown in datagrid. So at Delete button click i want to check datagrid rows 9before and after delete). so how can i do it using descriptive programming?
suppose i login into gmail page after that i read all the messages (say 10 messages) i have to send (SAVE) the messages in Html,notepad and i have to replay(Compose) send the messages please give me the code and give mail id so that i can clear my question
Is it possible to use two instances of UFT on the same machine? If not why?
I want to write some certification courses, so friends could you guide me? which certification is best and how to write exam and what tutorials need to be studied,what to do first, I am working on automation tool QTP 9.2