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.
Answer Posted / 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 View All Answers
give me an example where u used good judgement and logic in solving a problem
Explain quicktest professional (qtp) testing process?
I am a newbie to QTP / Automation testing. I want to develop a script that creates a data file automatically with proper headings using VBScript in QTP.
How will you test a keyboard?
How to analyzing test results using quicktest professional (qtp)?
What are the different recording modes and how do they work?
What are the different attributes used with regular expression?
what is run-time data?
How many types of parameters are there?
when u script reveiwing in which area u more concentrates?
How to remove the associated function library?
How to use parameterization in qtp?
Explain how Selenium is different from UFT?
how u will evaluate the tool for test automation?
i have to login into gmail loginpage i have to pass testcase into userid and password by using functions. the test case of user id is it should take only lowerletters alphabetin between 4 to 6 length.it should not take spectial letters.it should not take numbers.testcase for password is it should take numbers and it should not take alphabets note the following things must happen 1 when i give correct password and userid that password and userid should be seen in QTP result and notepad,xl sheet 2 when i gave in valid password the system willgive message please give valid password that particular messaage should be seen in QTP result,norepa and xl sheet