How can i open a file in Textpad and replace a string with
another using QTP

Answer Posted / madhavi

FileLocation="C:\Documents and Settings\\Desktop\file1.txt"

Set fso=CreateObject("Scripting.FileSystemObject")
Set fl=fso.OpenTextFile(FileLocation)
txtToReplace=replace(fl.ReadAll,"QTP","QTP9.5")
fl.Close

Set fl=fso.OpenTextFile(FileLocation,2)
fl.Write(txtToReplace)
fl.Close

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use parameterization in qtp?

716


how to download mercury qtp9.2 ny internet ?

3056


If you have two monitors one is of 19inch and the 2nd one is of 24inch,if you want to write same QTP script in both the two monitors is there any changes required in the script?

1666


Can we access the java methods in qtp. Because my requirement is to access the swt(for eclipse an it is java code) methods in qtp is it possible?

1631


How will you compare keyword and expert view?

620






QTP 10.0 is not identifying web objects for IE 8.it is identifying like winObject.I installed HP patch QTPWEB_00037.Still getting issue

5673


Give the syntax to load function at run time.

737


Can any one explain me what is the procedure to connect the remote desk by using QTP 9.2 ?

1603


what is impact analysis on regression testing?

2122


what are all the fileds present in object repository?

1647


Is it possible to switch between recording modes during a test creation?

680


Hi. I have completed B.TECH(CS) , But I will go to "SECURITY CONSOLE OPERATING" [C.C CAMERA abservation]. IF interviwer asks " Why you choose this job ?" What we will say? urgent.........................urgent...........

1537


They asked by using qtp recording writing scripting

2168


What are the general steps involved in the data driven framework?

638


How do know the number of browsers opened?

696