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
Object repositories types, which and when to use?
An action has both shared and local OR associated with it and both have the same object in them. In the test which one will be considered?
What are the 3 main stages involved in testing with qtp?
Can we Test Welcome Screens and Process Images with QTP
wt is the use of multiple questions in QTP
What is the parameterization? Give one example?
How do I lauch my test website using code from qtp in different environmet, uat and PPTE?
how to test load test and block box testing an a web based application pls give ans briefly
The structure of keyword driven frame work is like a folder structure the different sub folder are 1-functional libray folder 2-object repository folder 3- database folder 4-appliction1.xls 5-initalzation vbs file 6-sequence file 7-driver script 8-test case list file My question is whether these are in a local server machine or in our pc.((whether It like Vss). can u give example of driver script(code)
How many types of recording modes in qtp? Describe each type with an example where we use them?
I have 5 save buttons in 5 tabs . The tabs are placed one after the other. My object repository have these added as 5 save buttons with name sav1, save 2, save 3 , save 4, save 5 .all are getting highlighted from OR but they are not getting clicked. After spying each button all the properties are same except First button Index 0 html id:=btnSaveTab1 outerhtml:=", Second button "html id:=btnSave "outerhtml:=", Third button "html id:=", outerhtml:=",
How can i initiate the objects to find uniquely in OR
Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.
How to Get the Run-time value of an object under that web app under Test to the local data table sheet of that Action?
how can i pass a "automation script" as a parameter in a function give me need full suggestion thank inadvance