How reading PDF in new Browser Tab and verify text,elements etc [Katalon Studio]

130 views Asked by At

my goal is to check a PDF that opens in a new tab (any browser). I used Fontbox and PDFbox to check the PDF. I created a keyword that is meant to read PDF.

public class PDFReader {
   @Keyword
   def ReadPDF(String PDFURL) {
      URL TestURL = new URL(PDFURL);
      BufferedInputStream bis = new BufferedInputStream(TestURL.openStream());
      PDDocument doc = PDDocument.load(bis);
      String pdfText = new PDFTextStripper().getText(doc);
      doc.close();
      bis.close();
      println(pdfText);
   }
}

But unfortunately when I try to use a keyword to read me data from a new browser tab, the second browser window seems to be inactive so I have to substitute a ready link to the PDF to make it work. Is there any other solution to read and parse the PDF from the second window? I'm using Katalon Studio

I try to use a keyword to read me data from a new browser tab, the second browser window seems to be inactive so I have to substitute a ready link to the PDF to make it work. Is there any other solution to read and parse the PDF from the second window?

0

There are 0 answers