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

what is option explicit?

5 Answers  


what is framework and types of framework? Need of framework in automation? write folder strucuture of framework.

3 Answers   HealthAsyst,


Through array we can execute the testcase how ? give me example

0 Answers   TCS,


Whenever i'm running 3 diffrent scripts in a Test Batch Runner as a batch. its not showing any result. QTP only runs all the scripts n nothing else. B4 running the test batch i have done all the settings, But still its not working.

2 Answers  


requirement is for combo box your expected value is str= "Denver.Frankfurt.London.Los Angeles.Paris.Portland.San Francisco.Seattle.Sydney.Zurich" you must get the text in combo box and need to compare them how

0 Answers   FIS,






How to test login module with different username and password by using data driven testing in QTP?

0 Answers   HCL,


pls help me with scripting,right from the beginning in QTP

1 Answers  


How to retrieve value (data) from notepad using QTP ?

5 Answers   Health Care,


plz anybody tell me how to explain the architecture of one particular project.plz give me answer for this.....RAJESH

7 Answers   TCS, Wipro,


While testing .net applications with QTP 9.1 in normal recording mode, QTP records my unintentional mouse clicks and window dragging which I don't want. But I can't stop QTP recording those mouse clicks and window dragging. Can somebody let me know how I can get rid of it, please ! Thanks.

1 Answers  


Hello Everybody, please tell me how to use accessibility checkpoint and XML checkpoint by giving any practical example of it.please provide me the steps to perform that and also pls provide the code too. Thanks in advance, Gaytri

1 Answers  


what is the Debug view?

1 Answers  


Categories