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

what is use of the object repository?

4 Answers  


hi guys we r working in office...we write some scripts..suddenly we have a work(5min only) in out side..what will do now,,,used to system shut down or log off or lock or sleep mode,switch use or hibernate?

0 Answers  


I want to read XML file loaded in Quality center and compare the values with the values displayed in Application (web table).How can I do that

0 Answers  


How to maintain the old scripts in QTP?

2 Answers   Olive Tech, Wipro,


For Usability testing, which is preferable Automation or Manual?

6 Answers  






Suppose i have given 10 test cases all the test cases should be automated?

3 Answers   NTT Data,


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s.

0 Answers  


What is Environment Variable and when we apply this in QTP?

4 Answers  


How to find operating system information using the qtp script?

0 Answers  


PLS REAL TIMERS WRITE THE ANS FOR THIS? WHICH SCRIPT IS USED IN REAL TIME NOW A DAYS 1)SHARED REPOSITORY BASED SCRIPT 2)DESCRIPTIVE PROGRAMMING BASED SCRIPT?

1 Answers  


I am a beginner plz tell me,how do we write scripts in QTP? In my opinion we can write scipts in expert view or there is another option where we can write scripts. plz tell me.

5 Answers  


how to merge object repositories in qtp for n different applications

1 Answers  


Categories