Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8196933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:37:50+00:00 2026-06-07T05:37:50+00:00

I am using Watir to log into an application, push some buttons, etc… Basically

  • 0

I am using Watir to log into an application, push some buttons, etc… Basically the normal stuff that a person would use Watir for.

However, my problem is that there is one particular page that I need to test. It’s actually a dynamically-generated PDF and I need to get the actual binary data from it, so that I can load it using a certain gem that we’re using. This normally works with static PDF files because we can just use:

    open("http://site.com/something.pdf")

This works for static PDFs. However, for a dynamically generated one it doesn’t work because we are using Ruby to send the HTTP request and it is not aware of the headers/cookies/session that Watir is using. So instead of getting the actual PDF we get a login page.

Another thing we tried was to use Watir to get the PDF:

    @browser.goto "http://site.com/dynamic/thepdffile"
    @browser.text
    @browser.html

We tried getting the text or html from the page, but no luck because firefox creates a DOM when loading a pdf so the text is an empty string and the html is the DOM that firefox creates when viewing a pdf page. We need the raw HTTP response and there doesn’t seem to be a way to extract that.

So we need a solution for this and in my opinion we have these options:

  1. Figure out a way to use “open” or similar method in Ruby, using the session from Watir.
  2. Figure out how to use watir to get the binary http response from the PDF page.
  3. Disable the pdf plugin (which doesn’t seem possible) such that the “save as” dialog appears.

Or if you have some other idea please share! Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:37:51+00:00Added an answer on June 7, 2026 at 5:37 am

    I figured out a solution.

    In the profile for firefox you can set the plugin.scan.Acrobat to “999” which will effectively disable the PDF plugin.

        profile = Selenium::WebDriver::Firefox::Profile.new
        profile['plugin.scan.Acrobat'] = "999"
        b = Watir::Browser.new :firefox, :profile => profile
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Watir to write some tests for a web application. I need
I just started using Watir to write some simple tests for my web application.
I'm using watir-webdriver to interact with radio buttons in Firefox that are styled as
I've written an rspec test using Watir against a web application and it's running
I am currently using Watir with Firefox and it seems that when I try
I'm using Watir to do some automated testing for a website. This particular test
I'm using WATIR to control browser, but there is page that never fully loads
I'm trying to setup new text into a text field using Watir. The text
I'm using Watir 1.6.7. I'm working on developing some regression tests for a PeopleSoft
I have a script running watir-webdriver(using Firefox 4.0) that needs to access a web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.