ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Testing  >>  Automation Testing  >>  QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions
 Load Runner interview questions  Load Runner Interview Questions
 QTP interview questions  QTP Interview Questions
 Test Director interview questions  Test Director Interview Questions
 Rational TestSuite interview questions  Rational TestSuite Interview Questions
 Silk Test interview questions  Silk Test Interview Questions
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions
Question
I want to open a text file and then search some specified 
text in it and then replace that text with some other text 
i found that text in .txt but do not know how to replace 
that text can any body help me. if possible put the code 
for qtp
 Question Submitted By :: Ankur_jain
I also faced this Question!!     Rank Answer Posted By  
 
  Re: I want to open a text file and then search some specified text in it and then replace that text with some other text i found that text in .txt but do not know how to replace that text can any body help me. if possible put the code for qtp
Answer
# 1
Const ForReading = 1, ForWriting = 2
  Dim fso, f
  Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.OpenTextFile("c:\working\replace.txt", 
ForWriting, True)
   f.Write "QTP QTP RFT QTP QTP RFT QTP QTP"
   Set f = fso.OpenTextFile("c:\working\replace.txt", 
ForReading)
   ReadAllTextFile =   f.ReadAll
   newText = Replace( ReadAllTextFile, "QTP", "QTPRO") 
  Set textFile = fso.OpenTextFile
( "C:\working\replace.txt", ForWriting )
  textFile.WriteLine newText
  f.Close
 
Is This Answer Correct ?    2 Yes 1 No
Rico
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
i am entering wrong data or wrong password in a text box and click on submit button .i am getting a popup window with a message Please enter the correct password or data .How can i handle this situation by using QTP. SAP-Labs8
what is difference normal,analog,low level recording in qtp? what is lowlevel recording?  2
how qtp identifies objects of application. Intel5
we are submitting data one form to another form.defaultly it is time period set as 5sec. but it is taken 15sec what to do Covansys5
How we can add actions in the test using QTP?  1
Any one knows about descriptive programming to identify objects in a page? Kindly drop me mail prasanna.sabat@gmail.com  2
what is smart identification?  6
what sort of things what u put in Bug Report ?  1
what is a file system object in QTP  3
Where should we turn Smart Identification ON in QTP?  5
Which object repository we use in real time and can we merge 2 object repostiory and how? HCL6
write vbscript on veb applications in qtp with exapmles?  1
How many types of Recordings are there in QTP and what are they? First-Indian-Corporation6
There is a name "AJAY" how do u count no.of. "A" in that name ?  2
Can anybody give the code for ALL DATATABLE METHODS)(ex: datatable.getrowcount, datatable.getsheet etc....) and ALL DATABASE COMMANDS (like .getcelldata, which are used to retrieve data from a database and from a webtable)with examples. Accenture1
can QTP works on LINUX platfom  2
1) after inserting the check point how to change the expected value that was captured while inserting the check point TCS2
I am using Shared OR, and my collegues are also using Shared OR. How to merge Object Repositories?  6
What is data driven testing in QTP? Agile-Software6
Explain synchronization types in QTP  2
 
For more QTP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com