Is there a way to test PDF?

Hi all,

My application is rendering a PDF that i need to test, is there anyway get this file to test it against my expected pdf result?

Thank you for your answers

try image compare (openCV+Sikuli) or image OCR (openCV+tesseract)

@Aleksei : thank you for your answer, but my actual question is that i need to get this file from device, like using driver.get () in selenium…?

did i say something other? with Appium in Selenium you will get screenshot. Then analyze screenshot with any available method. Example of possible analyze i mentioned.

1 Like

Appium has a pull_file method that reads the file into memory. We’ve written this (Ruby) wrapper around it to put the contents into the specified file.

def pull_file(source, dest)
  contents = appium_driver.pull_file(source)
  File.open(dest, 'wb') {|f| f.write(contents) }
end
2 Likes

@willosser it’s perfect, this is exactly what i was looking for ! Thank you!

This man is genius :slight_smile: