#1 - Read PDF and Validate Content using PDFBOX in Selenium

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2022
  • #pdfbox #readpdf
    Read PDF and Validate Content using PDFBOX in Selenium
    GIT Repo:
    github.com/naveenanimation20/...
    Schedule a meeting in case of any queries/guidance/counselling:
    calendly.com/naveenautomation...
    ~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
    th-cam.com/users/Naveen%20Au...
    Follow me on my Facebook Page:
    / naveenqtpexpert
    Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
    t.me/joinchat/9FrG-KzGlvxjNmQ1
    Naveen AutomationLabs Paid Courses:
    GIT Hub Course:
    naveenautomationlabs.com/gitc...
    Java & Selenium:
    naveenautomationlabs.com/sele...
    Java & API +POSTMAN + RestAssured + HttpClient:
    naveenautomationlabs.com/manu...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 56

  • @naveenautomationlabs
    @naveenautomationlabs  ปีที่แล้ว +4

    In this example, we are using driver to launch the browser and url. But not using the driver in PDFBOX code as I could not find the right example online.
    In real time use case, you can click on pdf link from the web page and get the href/url value of the same link and use it in PDFBOX code in URL class object.
    example:
    String url = driver.findlement(pdf_link_element).getAttribute("href);
    URL pdfUrl = new URL(url);

    • @neharai4959
      @neharai4959 9 หลายเดือนก่อน

      getting java.io.IOException: Error: End-of-File, expected line at offset 5565 at pddocument.load(bf) in below program: URL url=new URL(pdfurl);
      URLConnection urc=url.openConnection();

      urc.addRequestProperty("User-Agent", "Mozilla");
      int responseCode = ((HttpURLConnection) urc).getResponseCode();
      if (responseCode == 200) {
      InputStream is=urc.getInputStream();
      BufferedInputStream bf=new BufferedInputStream(is);
      PDDocument pd=PDDocument.load(bf);
      int count=pd.getNumberOfPages();
      System.out.println(count);

      } } please help me out.

  • @SarangHoley
    @SarangHoley ปีที่แล้ว +1

    Long back you had made a video on this, good to see a updated vision of it, Thank you Naveen 😊

  • @peacelilly2200
    @peacelilly2200 ปีที่แล้ว +1

    I learn a ton of things from your video. The content is straight forward and the explanation every time is crystal clear. Thank you so much for making such videos.

  • @ABAutomationHub
    @ABAutomationHub ปีที่แล้ว +1

    Thanks for covering topics like this.. It’s very useful..

  • @soumyajitnath1348
    @soumyajitnath1348 ปีที่แล้ว +1

    Really too useful ! Your videos always gives a kick to me to learn more.
    Please make a video on threadlocal which can be used to run tests parallel at test method level in an automation framework

  • @naveenkumars9132
    @naveenkumars9132 ปีที่แล้ว

    Hi Naveen,
    Do we have any option to validate Bold text/sentence in the pdf ? Like i got a scenario to validate a particular sentence in the pdf are bold.

  • @ravirajug1137
    @ravirajug1137 ปีที่แล้ว +2

    It is really helped me. Thanks for such nice video.

  • @user-rw8yu1ik2c
    @user-rw8yu1ik2c ปีที่แล้ว +1

    Thanks for sharing. I take "java.io.IOException: Error: End-of-File, expected line at offset 636". Do you have any idea to handle it?

  • @malleshmalli809
    @malleshmalli809 ปีที่แล้ว

    Thank you Naveen ..it's very useful video ..thank you so much

  • @AK-rx5yp
    @AK-rx5yp 9 หลายเดือนก่อน +1

    Can you pls explain important scenario here as we see multiple tables here say the row with Name as key should contain value as Naveen....
    How to automate this pls???

  • @nigaraliyeva1240
    @nigaraliyeva1240 ปีที่แล้ว

    Thank You Naveen!

  • @archanamuthukrishnan6465
    @archanamuthukrishnan6465 ปีที่แล้ว

    Hello Sir
    In my project am using properties file to read credentials and url .but they asking not to use the same..can you please let me know the alternative?

  • @shwetakatare24
    @shwetakatare24 ปีที่แล้ว

    Thank you for this video💯😊

  • @suryadeepsrivastava7645
    @suryadeepsrivastava7645 11 หลายเดือนก่อน

    Hi Naveen, i am working in a banking project, my application has an embedded pdf, I need to validate the pdf content. When I pass the pdf url, I get a connection timed out exception. Can you please help?

  • @pawanchandra7158
    @pawanchandra7158 ปีที่แล้ว

    Hi Naveen,
    Why can't we pass InputStream object directly to PDDocument class..Why are we creating BufferedInputStream class object

  • @raghadraghad8433
    @raghadraghad8433 10 หลายเดือนก่อน

    Hi
    I got error of java.lang.NoClassDefFoundError: org/apache/pdfbox/pdmodel/PDDocument
    Although I exported fontbox pdfbox jars as external libraries
    What should I do?

  • @raghadraghad8433
    @raghadraghad8433 10 หลายเดือนก่อน

    Hi
    How can I select Save as pdf option from chrome printing dialog and the pdf file?

  • @mayurubale9102
    @mayurubale9102 ปีที่แล้ว +1

    Thank u sir !

  • @knowledgeTransfer31
    @knowledgeTransfer31 ปีที่แล้ว

    Hi Naveen , I ma getting
    FileNotException what migh tbe the reason but the file is not in the destination path

  • @arnaldoadiputra681
    @arnaldoadiputra681 ปีที่แล้ว

    is it possible to screenshoot the pdf from the webbrowserview ? like all the way until the last page ?

  • @softwaretestinglearninghub
    @softwaretestinglearninghub ปีที่แล้ว +1

    Great content Naveen, thank you!

    • @punampatil7355
      @punampatil7355 ปีที่แล้ว

      Hi Naveen, I want to read recent downloaded pdf from its downloaded folder and verify it's title.

  • @surajsurya1414
    @surajsurya1414 ปีที่แล้ว

    Thanks for sharing this. It would be really helpful if you can make a video for same with Cypress. I have a scenerio, where I have to create a sales invoice. On saving it, browser print popup is displayed and I have to assert some values on it.
    Thank you in advance.

  • @vaishalilahudkar2795
    @vaishalilahudkar2795 ปีที่แล้ว

    Hi sir,
    Why here headless cromeoption used and passed in driver instance

  • @YasmeenFatimaAbdi
    @YasmeenFatimaAbdi ปีที่แล้ว

    When I am trying to download pdf file, then pdf file is opening in new tab and unable to handle clicking on save file to my local . How can I save read only pdf file when we are restricted from company to download file? Can you please help me with the code. Thanks

  • @mrleoim
    @mrleoim ปีที่แล้ว +1

    Hi Naveen, your video on PDF validation is very good. Can you do video on using selenium to automate the mainframe screens like IBM personal communications

  • @raj-we9yr
    @raj-we9yr ปีที่แล้ว

    Thank you for the nice video. Is it possible to specify a particular table in a page and extract just that specific table from the PDF document

  • @vigneshelumalai1916
    @vigneshelumalai1916 ปีที่แล้ว

    can we click a button on pdf to redirect to my application

  • @Sai-Ram-1234
    @Sai-Ram-1234 ปีที่แล้ว

    How to read the content of the pdf content is encrypted using pdf text stripper?

  • @Gaurav12081
    @Gaurav12081 ปีที่แล้ว

    Hi Naveen same video can you make for XML validation currently in my company we are validating invoice extract XML against DB thanks.

  • @dhrusoni1
    @dhrusoni1 11 หลายเดือนก่อน

    Does it possible to asserting charts ?

  • @anjankumar4012
    @anjankumar4012 ปีที่แล้ว

    Thanks for the video,
    I was searching for a way for my project.
    Really helpful .❤️
    Can you please make a video on how to save screenshots in Word file.
    That will be really helpful

  • @delankoh3494
    @delankoh3494 ปีที่แล้ว

    How can we validate images or signatures in pdf?

  • @radhakrishnanp2578
    @radhakrishnanp2578 ปีที่แล้ว

    Hi Naveen will you kindly upload the video on how to assert it and extract the images from the pdf?

  • @rameshkrishna6103
    @rameshkrishna6103 6 วันที่ผ่านมา

    Nice Video. Thank you. Can we search a text in the PDF and "move" to the text one by one as we do on a PDF or other document search?

  • @srikanthmaragoni4291
    @srikanthmaragoni4291 ปีที่แล้ว

    Hi sir can u explain how to download and validate the same pdf file using selenium webdriver (without giving url' s)

  • @syedwaseemahmed1749
    @syedwaseemahmed1749 11 หลายเดือนก่อน

    How validate pdf contain hiper link??

  • @chakshitvlogs8766
    @chakshitvlogs8766 ปีที่แล้ว

    Hi Brother,
    I have been following your videos so regularly. Can you able to make a video related to extracting tables from pdf file using any third party library

  • @botchulamunesh2854
    @botchulamunesh2854 ปีที่แล้ว

    Bro how table data like this type

  • @swethanainampudi4261
    @swethanainampudi4261 ปีที่แล้ว

    Hi Naveen, Do we have a way to read the PDF content from the blob url?

    • @naveenautomationlabs
      @naveenautomationlabs  ปีที่แล้ว +1

      Blob url is not directly support with selenium. You can download the pdf and then launch it selenium or try the blob url directly with pdfbox.

  • @jobcurator2413
    @jobcurator2413 ปีที่แล้ว

    Whats the use of driver.url("url of pdf") when we are anyway creating URL for PDF file directly ?

    • @naveenautomationlabs
      @naveenautomationlabs  ปีที่แล้ว

      yes correct.
      In this example, we are using driver to launch the browser and url. But not using the driver in PDFBOX code as I could not find the right example online.
      In real time use case, you can click on pdf link from the web page and get the href/url value of the same link and use it in PDFBOX code in URL class object.
      example:
      String url = driver.findlement(pdf_link_element).getAttribute("href);
      URL pdfUrl = new URL(url);

  • @vinayakm9389
    @vinayakm9389 4 หลายเดือนก่อน

    Hi Naveen, really very useful video, I tried to do it, Im facing this error,
    Any suggestions please how to come out, stackOverFlow didn't give answer on same.
    Java.io.IOException: Error: End-of-file, expected line
    Here Scenario is pdf is added inside the regular text page

  • @mangeshmunde9347
    @mangeshmunde9347 ปีที่แล้ว

    Hey Naveen, can you share API document Pdf....you have explained in video..

  • @aruns5896
    @aruns5896 ปีที่แล้ว

    Nice Video Naveen. Thanks . When the client or user wants to validate the pdf using selenium because they can directly open the pdf and validate ?Share the real time scenario

  • @KARTHIKPANCH97
    @KARTHIKPANCH97 ปีที่แล้ว

    Hi Naveen.
    I am part of your Selenium Java training batch of 11th Nov
    Would you be covering this topic in that as well.
    It would be great so all topics would be at once place for easy reference
    Thanks.

  • @singh07neeraj
    @singh07neeraj ปีที่แล้ว

    Hi Naveen how to test if some PDF is open within the browser please cover this too

  • @homaassal2794
    @homaassal2794 ปีที่แล้ว

    This method does not work if the pdf opens as a popup inside the same browser window

  • @ravirajug1137
    @ravirajug1137 ปีที่แล้ว

    pdfText.contains not searching string = De , rest all doing this.

  • @neamafouad57
    @neamafouad57 ปีที่แล้ว

    Thank you for this helpful video, but there are some characters are changed when reading pdf and print it ,Do you have any idea why this ?