what is a file system object in QTP
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / bala
In simple terms "Filesystemobject" is an object model which
is used to handle the drives, folders, and files of a
system or server.
If an user needs to work Driver, Folder, Files properties,
methods or events then the first step he need to setup is
filesystemobject.
Hope this helps. Let me know if you need an example.
Is This Answer Correct ? | 14 Yes | 1 No |
Answer / manju
File system object is an interface between QTP and the
local system. using FSO we can create/delete folder,
create/delete/read from/write to text files
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / prashanthkumar
Hai Bala,
Just now i read ur defination on File system object.
well, it would be more specific ,if u could explain with an
example...
I appreciate,if u can do that now.
Thx.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / smitha
correct code
const ForReading = 1, ForWriting = 2
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("D:\New
Folder\somefile.txt",ForWriting, True)
MyFile.WriteLine "Hello world!"
MyFile.WriteLine "The quick brown fox"
MyFile.Close
Set MyFile = fso.OpenTextFile("D:\New
Folder\somefile.txt",ForReading)
ReadLineTextFile = MyFile.ReadLine ' Returns "Hello world!"
MyFile.ReadLine
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / brahma
fso is a another methode for writing VB script in notepad. by using this F.S.O we can create folders and files in our machine.this is interface b/w layer1 and layer3 instead of obect repocitory.
simply we can define
layer1----obect repocitory---layer3(application like flight)
but
layer1---F.S.O--------layer3
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / mm sarwar
Set objFile = CreateObject("Scripting.FileSystemObject")
Set myFolder = ObjFile.CreateFolder ("C:Program FilesFSO")
If objFile.FolderExists ("C:Program FilesFSO")
MsgBox "Folder is Created"
End If
Set myFile = objFile.CreateTextFile ("C:Program FilesFSO ext_01.txt")
If objFile.FileExists ("C:Program FilesFSO ext_01.txt") Then
MsgBox "File Created"
End If
myFile.WriteLine "Hello World"
myFile.Write "We are practicing UFT."
myFile.Write "One day all of us get a Job"
myFile.Close
Is This Answer Correct ? | 0 Yes | 0 No |
How to export QTP results to an ".xls" file?
I've some problem in Descriptive programming plz help me. I've written in a click event code in Functional library when I run this flight reservation program It is not run. How to I write multiple click event in functional library. My program is this. I have associate an action with functional library. Public Function ClickButton(byval ApplicationName, byval WindowName, byval ObjectName, byref Comments) If Dialog("text:=" &WindowName).WinButton("text:=" &ObjectName).Exist Then Dialog("text:=" &WindowName).Activate Dialog("text:=" &WindowName).WinButton("text:=" &ObjectName).Click Elseif Window("text:="&ApplicationName).WinButton("text:=" &ObjectName).Exist Then Window("text:=" &ApplicationName).Activate Window("text:=" &ApplicationName).WinButton("text:=" &ObjectName).Click End if End Function
terminal services client
What kinds of security (firewalls, encryptions, passwords, etc.) will be required and what is it expected to do? How can it be tested?
What is the difference between functions and actions in QTP?
how can i parameterize a login page by using database parameterization i fetch the username and password from database and put this on login page and click on ok button. so how can we write script for that code please let me know asap thanks
How to measure transaction time through VBScript without using start and end transaction points?
what is command for executing files?
CAN ANY ONE PLEASE EXPLAIN DIFFERENT TYPE OF FRAMEWORKS USED IN QTP?EXPLAIN EACH OF THEM?..POST TO VANILKUMAR_1981@YAHOO.CO.IN
How to see entire results at the same timeafter the batch run.. Cannot see the entire results at a time. Is there a easier way view everthing at same,as our batch file very large
How to count the no of objects in XML file(QTP)
In my QTP script I have a word in notepad that ends in a question mark, for example... "father?" As part of my script I want to delete the question mark. How do you delete a character in notepad?