Forum Discussion
marin
12 years agoFrequent Contributor
Hello Dezza,
I have a similar scenario in one of my test cases.
The approach I am using is to capture entire contents of the PDF document into clipboard and then search for the string in question:
Hope this helps.
Regards,
Marin
I have a similar scenario in one of my test cases.
The approach I am using is to capture entire contents of the PDF document into clipboard and then search for the string in question:
//Capturing entire contents of PDF document from Adobe Reader popup into clipboard (CTRL + A, CTRL + S)
//and converting the variant into string, then searching the content for desired substring
Aliases.AcroRd32.wndAcrobatSDIWindow.AVSplitterView.AVSplitterView.AVSplitationPageView.AVSplitterView.AVScrolledPageView.AVScrollView.AVPageView.Keys("^a^c");
var clip = aqConvert.VarToStr(Sys.Clipboard);
var chkRefNo = aqString.Find(clip, "ABC_123");
//searching for "ABC_123" in clipboard
if (chkRefNo < 0)
{
Log.Error("Reference number ABC_123 is not displayed on PDF.")
}
else
{
Log.Checkpoint("Reference number ABC_123 is displayed on PDF.")
}
Hope this helps.
Regards,
Marin