Search This Blog

Tuesday, November 23, 2010

Functionality: Compare the data in PDF, using VB script

Copy paste teh belwo 3 steps continuously, by just delete the step names.

Step 1:
First Create a object for clipboard
Set objCB = CreateObject("Mercury.Clipboard")
objCB.Clear
Step 2:
If Browser("title:=https://Browser name").ActiveX("acx_name:=Adobe PDF Reader").WinObject("text:=AVPageView").Exist Then
Browser("title:=https://Browser name").ActiveX("acx_name:=Adobe PDF Reader").WinObject("text:=AVPageView").Type micCtrlDwn + "a" + micCtrlUp
Browser("title:=https://Browser name").ActiveX("acx_name:=Adobe PDF Reader").WinObject("text:=AVPageView").Type micCtrlDwn + "c" + micCtrlUp

If Browser("title:=https://Browser name").Dialog("nativeclass:=#32770").Exist then
Browser("title:=https://Browser name").Dialog("nativeclass:=#32770").Winbutton("text:=OK").Click
End If

Step 3: Now you search the text you want to check in PDF

strUID = "Help"
PDFTxt = Instr(1, objCB.GetText, strUID)
If (PDFTxt > 0) Then
reporter.ReportEvent micPass, "id exists", "id there"
Else
reporter.ReportEvent micPass, "id not exists", "id not there"
End If
End if

Browser("title:=https://Browser name").close
Set objCB = Nothing

No comments:

Post a Comment