Posts Tagged: "pdf"

Read PDF file using Selenium Webdriver

Download pdfbox and fontbox jars from https://pdfbox.apache.org/download.cgi To read pdf file and verify the content is present in the pdf using. import java.io.BufferedInputStream; import java.io.IOException; import java.net.URL; import org.apache.pdfbox.pdfparser.PDFParser; import org.apache.pdfbox.util.PDFTextStripper; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.annotations.Test; public class PdfRead { WebDriver driver = new FirefoxDriver(); public void verifyPdfContent(String[] values) throws IOException { URL url […]