How to compare 2 excel files using QTP?
How to compare 2 PDF files using QTP?
Answer Posted / srihari j
How to compare 2 PDF files using QTP?
Dim varPath1, varPath2, str1, str2
varPath1 = "C:first.pdf"
varPath2 = "C:second.pdf"
str1= getPDFText (varPath1)
str2= getPDFText (varPath2)
if StrComp(str1,str2,0) <> 0 Then
msgbox "PDF files do not have same text content"
else
msgbox "PDF files have same text content"
end If
Public Function getPDFText (varPath)
Dim MyClipboard
SystemUtil.Run varPath
Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AdobeAcrobat").Type micAltDwn + "t" + micAltUp
Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AdobeAcrobat").Type "s"
Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AdobeAcrobat").Type micDwn
Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AdobeAcrobat").Type "Enter"
Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AdobeAcrobat").Type micCtrlDwn + "a" + micCtrlUp
Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AdobeAcrobat").Type micCtrlDwn + "c" + micCtrlUp
Set MyClipboard = CreateObject("Mercury.Clipboard")
getPDFText = MyClipboard.GetText
MyClipboard.Clear
Set MyClipboard=Nothing
Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AdobeAcrobat").Activate
Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AdobeAcrobat").Close
End Function
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is action?
when I was doing the web testing with QTP using with standard checkpoint the Object selection -checkpoint properties dialog box not displaying pages and links hierarchical order. Could you please tell me. thanks
tell me abt a time when u had to go above &beyind the call of duty to get the job done
What is the difference between byref and byval in qtp?
What is the syntax to call one script from another?
What is QTP testing process?
How many add-ins comes by default with quicktest professional (qtp)?
What does mean by Scope of Automation?n How we defined it?
What is fragmentation and paging?
If an application name changes frequently i.e while recording it has the name, in this case, how do qtp handles?
Hi, I'm a beginner in QTP and planning of a certification in QTP, but have no idea about it :P. Could anyone please tell me what certifications that a QTP- beginner can take? What is the fees and the syllabus for the certification? Please reply soon. Thanks Vidhya
This is Karthic and my mail id is karthic.venkitapathi@gmail.com, please give me an idea to crack qtp 10
How you can decide which type of object repository you have to use?
What is different command used in command Prompt while using QTP?
Define Canvas view of UFT?