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
How do you synchronization point through DP?
How would you directly trigger javascript in a test?
Where is the resultset of a sqlquery (which is fired by rsobj.open sqlquery,xxxx,xxxx) stored ?
In QTP TEST DIRECTOR COMBINATION WHAT IS THE PURPOSE OF TEST DIRECTOR? In Somebody says to store test cases and design test cases.?ok fine , but In test director 5.0 , QTp not launching. what u do?
Explain xml checkpoints.
What are the different recording modes?
How do you create new test sets in td?
How to use transactions in qtp?
How do you do batch testing in wr & is it possible to do in qtp, if so explain?
What we are looking for is to load properties of object dynamically as for our application the global repository will pretty huge. It will be really helpful to us if something similar to following functions of Winrunner is available in QTP. #Define descriptor auto strDesc; #set property in the descriptor Gui_desc_set_attr(strDesc,?Class?,?Edit?); --- put other properties #Add Edit box to GUI Map Gui_add(? ?,strWindowName,strEditboxName,strDesc);
How can I check if a environment variable exist or not?
Analyzing the checpoint results?
What are the recording modes in wave event?
We stored into the objects OR and then write the scripting
Hi friends I need to know about jubula automation tool. Is anybody know in bangalore where jubula tanning class is going on do let me know. Its urgent for me to learn that tool please help.