Code: Select all
[ ] System.SetClipboard({}) // clear the Clipboard of any prior information
[ ] PDFWindow.Click()
[ ] PDFWindow.TypeKeys("<Ctrl-a>") // highlights the entire set of text of the PDF
[ ] PDFWindow.TypeKeys("<Ctrl-c>") // copies it to the clipboard
[ ] Sleep(2)
[ ] List<String> lsClipboard = System.GetClipboard()
Code: Select all
[]Print(lsClipboard)
[1] Line 1
[2] DataName: Value
[3] blah blah
....
You can then use all of the String methods available to verify the various lines. For example, I had a line that looked like:
[8] Name: Harry Smith
I needed to verify the name was "Harry Smith" so I did the following:
Code: Select all
[]VerifyValue("Customer name is correct: ", "Harry Smith", lsClipboard[8].GetField(": ", 2))