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

Hi, How Accessibility checkpoint in QTP can be implemented in the test script?

1869


wt is the use of multiple questions in QTP

1905


Is virtual object supported in low level recording mode?

898


Does Low-level recording capture mouse movements?

799


what type of run time errors you get while you ar edoing rpg program?

1715


How did you resolve conflicts present in Object Repository?

1826


A FORM CONTAINS 5 FIELDS. 1 FIELD IS ENABLED REMAINING(4) FIELDS DISABLED. MY QUESTION IS ENTER VALUES INTO 1 FIELD AFTER THAT CLICK TAB BUTTON THEN 2 FIELD ENABLE THIS PROCESS CONTINUE UPTO 5TH FIELD. HOW TO WRITE CODE IN DESCRIPTIVE PROGRAMMING. PLZ TELL ME THE PROCEDURE AND CODE FOR IT.

1511


How to customize checkpoints with parameters?

3247


how to download mercury qtp9.2 ny internet ?

3217


Hi Samrat, Thank u very much, what u said it is right.

1668


How to analyzing test results using quicktest professional?

906


1.explain end to end process of qc,2.how many tabs are in qc9.0,qc10.0 3.what is review, how many reviews are following in aproject 4.how will you get the requirements 5.why do we choose testing 6.how to export tc's and requirements to qc through add-ins

1682


How to use setroproperty?

773


Is it possible to call win runner script in qtp?

864


What is the difference between rational rose and QTP?

2011