How can I replace all the text from the QTP script with
some other text.
Is there any replace all function in QTP
Any one can help me

Answer Posted / aiswaryan

I could not find any function for this. We can do by this
script.

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("C:\ais\Totally Data.doc",
ForWriting, True)
f.Write "Hello world!"
f.Close

this will replace everything in the given file and write
the text ta u hav given.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How smart identification works in qtp ?

574


Hi, i run scripts in one machine those r passed.when i run the scripts in client side those r failed.Give me such a scenario when ever u faced?

1509


hi all here i have tab named "Workbench" By clicking on "workbench" tab.it displays 4 tabs like below workbench common cargo commercial charter "common" tab have 10tabs inside,"cargo" tab also haveing 15 tabs inside and remaining two tabs also having few tabs inside. when clicked on "common" tab.it displaying the script like tab("workbench").select"common" if i clicked on "cargo".it displaying the script like tab"workbench_2").select"cargo" if i clicked on "commercial".it displaying the script like tab"workbench_3").select"commercial" if i clicked on "charter".it displaying the script like tab"workbench_4").select"charter" I have used a "FOR LOOP" for common,commercial,cargo,charter tabs.it was stopped at second tab SO, CAN I RECOGNIZE "WORKBENCH_2,_3,_4" AS A SINGLE VARIABLE if not, can anyone plese help me to solve this

1510


When we r doing data driven test with chkpts, i want to insert formulae in data sheet but i didn't get. How we wil do that plz. explain in detail.

1599


What are the types of object repositories? Which one is you are using?

627






tell me abt a time when u had to go above &beyind the call of duty to get the job done

1438


Pls can anyone give me the entire code for the Keyword driven framework with respect to he Flight Reservation Window in detail with explanation. Pls explain in detail stepwise. Thanks a lot. Pls very urgent?.

1517


What is reusable action?

596


can any body give the banking domain concepts/links

3631


Can we use index on view?

1595


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

1571


Diff b/w test scenario's and test Procedures?

1624


In the application that I'm testing is having a WYSIWIYG editor.QTP is recording editor's body as web element. I want to add some data to this web Element at run time. The problem is that I cant find a method to add contents to this web Element. Can any one come up with an answer for this. Thankx.

1439


When to use shared and local object repository?

628


is there any addin for remedy user application

1742