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

what is the frame work in J-meter?

1844


How can i get the image text that changes dynamically? Here i have used "GetROProperty", but it's not working. I used like Ex:Browser("webmail").Page("inbox").image ("captchaimage).getroproperty("innertext/text/value")

1645


How is test case write?

793


Hi How to retrieve data from web element line by line?

1792


How does you pass optional arguments in qtp?

788


can any body plz help by sending the qtp docs and qtp ppt's? this is my mail id:murali.padeti@gmail.com

1985


action contains public and private functions but do we resuable that action or not..If it is reusable How..plz tell me the ans

1840


I used child objects to get the no of weblist present in the weblist.now i need to select the items present in each weblist ?How to do so

2467


Explain building blocks of the bpt framework ?

790


Hello everyone! I am just writing a small test for a windows application. I have a problem with a text output value. The value i am trying to catch is presented in a scrollable textbox. When the text is too long, only a portion of it gets captured. Do you have any experience with this?

2370


in a web page How to check and display a particular word from a paragraph?

2289


Can we Test Welcome Screens and Process Images with QTP

1692


explain abt dyanamic changing object with example?

2102


how to test Web application using QTP software

1542


How do you configure QTP AND Test director?

1709