top of page

Validate pdf data using Selenium Webdriver

Read PDF content to validate its content using PDFbox libraries in Selenium Webdriver.


PreReq:

Add dependency of PDFbox:

PDDocument document = PDDocument.load(pdf_file_path);
PDFTextStripper PDFstripper = new PDFTextStripper();
String content = PDFstripper.getText(document);

System.out.println(content);

If("your_content").contains(content)
{
System.out.println("Pass");
}else{
System.out.println("Content not found");
}




73 views0 comments

Recent Posts

See All

POM Concept

While writing a page object method which of the following "method signature" you think is/are correct & Why? public String getScreenDataAndGoToNextScreen() public boolean login(String username, String

Comments


bottom of page