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



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

Answer / 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

More QTP Interview Questions

In automation testing Can we retest virtual object in the application after getting new version from the developers, is there any property will change for that object or it won't.?

1 Answers   Siemens,


write progamming connecting QTP to database sql? this is question asked by interview? pls any answer this?

4 Answers   IBM,


1) What is the diff Between GetRoproprty and Gettoproperty? 2)What is Redim?

5 Answers   STC,


Mention the different actions types of qtp.

0 Answers  


will QTP accepts javascript?

14 Answers   AppLabs,






How to get the column count and column name from the resultset in the database connection program?

6 Answers  


explain keyword driven framework?

2 Answers   Mindlance,


How to remove associated function library?

0 Answers  


How to call script1 into script2?

3 Answers  


Could any one suggest web site links to learning VB Script for QTP purpose??

3 Answers  


I have 3 add buttons of same properties in my page but i want trigger one of them i required in my recovery scnario manager is qtp recognizes it to recovre d scnario if so how qtp recognizes it

3 Answers  


Hi, Any one have the crack for QTP 10.0,if so could you please send it to phanijuly10@gmail.com

2 Answers  


Categories