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

What is action? How many types of actions are there in qtp?

617


How do I lauch my test website using code from qtp in different environmet, uat and PPTE?

1463


Explain the concept of object repository and how qtp recognises objects?

532


Get the count of files of similar types from a folder.

976


How can I check if a environment variable exist or not?

544






How to Open FireFox using descriptive programing? If my question is not clear, i will give an Example To Open Internet Explorer, We use Set IE = CreateObject(InternetExplorer.Application) IE.Navigate "www.yahoo.com In the same i need to open yahoo.com in firefox. Can any one tell me what is the server name of firefox to create an object

2530


When do go for loop condition in test?

658


Which features or drawbacks of QTP lead to the upgrade for a newer version?

576


Write the script to delete the mail which is at 9th,13th and 18th place in INBOX of Gmail ?

1682


What is quick test pro?

593


what is the difference between data driver & data driven and driver script?

2143


In qtp, how you can remove the spaces from string?

549


Explain how you can delete excel file in qtp?

594


I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format, if possible, kinldy mail PDF file to my mail-ID: ramakrishna908@gmail.com Regards, krishna.

1469


Explain how qtp identifies object?

613