what is a file system object in QTP

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


Please Help Members By Posting Answers For Below Questions

What is the difference between Keyword Driven test and Data Driven test?

1993


Explain xml checkpoints.

843


how to know no.of mails in our g mail by using vb-script

1985


when will you do debug your script? and explain that process?

1658


UFT 12.02 which ALM version will support

1201


What are the five challenges you faced in QTP?

2956


Where we use data driver in qtp?

791


What is environment variable in qtp and why to use it?

756


What are the main differences of qtp and win runner?

820


What is QTP testing process?

817


what is keyword driven testing in qtp?n how is it useful?

1679


when I try to run below script in QTP "totalPages" value is 2. But i am getting error message (Type mismatch: 'totalPages' Line (): "For i=1 to totalPages".) totalPages=Browser("Name:=User").Page("Title:=User").WebElem ent("innertext:=of.*").GetROProperty("InnerText") msgbox totalPages For i=1 to totalPages rnum=Browser("Name:=User").Page("Title:=User").WebTa ble("column names:=User Name;ID;Last Name;First Name").GetRowWithCellText("store4") If rnum>0 Then r=rnum Exit for End If Browser("Name:=User").Page("Title:=User").WebElement ("html tag:=A","x:=471").Click MsgBox "Exit" Next

3575


How to Test the mainframe application?

2056


What is the standard timing delay for web based application in qtp?

824


which type of testing process are you following in ur company? how to recognize a qtp page?

1584