How to match two doc files using qtp
requirment is:- each and every single word of a doc file
should be matched with the another doc file. can someone
send me the code.



How to match two doc files using qtp requirment is:- each and every single word of a doc file sh..

Answer / kavitapriya cr

Use the script below:
Dim fso,FileName1,FileName2,File1,File2
Set wrdApp=CreateObject("Word.Application")
Set FileName1=wrdApp.Documents.Open("Path\FileName1.doc")
Set FileName2=wrdApp.Documents.Open("Path\FileName2.doc")
Set File1=fso.GetFile(FileName1).OpenAsTextStream(1,0)
Set File2=fso.GetFile(FileName2).OpenAsTextStream(1,0)
CompareFile=True
Do While File1.AtEndOsStream=False
String1=File1.Read(1000)
String2=File2.Read(1000)
If StrComp(String1,String2<>0) Then
CompareFile=False
Exit Do
End If
Loop
If CompareFile=True Then
MsgBox "Files are matching"
else
MsgBox "Files are not matching"
End If
File1.Close
File2.Close
FileName1.Close
FileName2.Close

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

Can you expect major bugs in Net banking Application?

1 Answers  


WHAT IS DIFFERENCE B/W QC 9.2 AND QC 10.0

1 Answers   SoftTech,


how can we test the Triggers, Cursors, Indexes while doing Database testing in DTP??

0 Answers   ABC,


in QTP we test web based application at that time what script is run? is support vb script? plz tell me

3 Answers  


Hi , I am facing issue QTP 10.0 with oracle ERP 11i .When QTP opens,click sub links on ERP ,FORM is not opening getting unexpected Internet explorer error message with send or don't send report.So unable to work with forms using QTP.

0 Answers  






write script for "dropdown button having how many words? for ex.SELECT CITY is dropdown name.. find out how many cities in that?

1 Answers  


what is exact difference between smoke and sanity testing?

6 Answers   Satyam,


how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)

0 Answers  


1.How recognize QTP Dyanamic Image? (suppose tha wedpage contains 3 logos..1 square 2.circle 3.rectangel)there changing at same position how to capture that)

3 Answers   Synechron,


My company has recently started using Ajax for building UI and QTP is nor recognizing the drop down list for selection.It recognises it as a general Web Element or Web Table. I have added individual selections from the drop down as web Table. It works as long as the page is not refreshed. I need some help and inputs as to how to make QTP recognise a drop down list for selection. Any help will be appreciated.

1 Answers  


How to Run a Test using QTP?

1 Answers  


Explain qtp(quick test professional)?

0 Answers  


Categories