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 3277918
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:25:24+00:00 2026-05-17T19:25:24+00:00

When I read out the HTML returned by Watir, it gives me a page

  • 0

When I read out the HTML returned by Watir, it gives me a page directing me to come back on a browser through my Mac or PC. It seems I am being redirected by a user agent given through Watir. I thought I was driving the browser with Watir, but this doesn’t seem to be the case.

ie = Watir::IE.new
ie.goto "http://www.apple.com/safari/download"

ie.checkbox(:name, "21.1.9.12.3.1.3.0").clear

Which returns an UnkownObjectException. Same with trying to click the submit button.

Using firebug I can find the checkbox fine, that’s how I found the :name. So I next redirected the HTML output from Watir into a file for inspection,

myfile = File.new("safaridebug.html", "w+")
myfile.puts ie.html
myfile.close

Looking through safaridebug.html is where I noticed I was on a different page from the web browser. Is there someway in watir I can get the actual HTML that is present in my web browser, maybe a user agent spoof? Thanks.

System Specs:
VM running Win XP SP2,
ruby 1.8.7,
IE 8

  • 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-05-17T19:25:25+00:00Added an answer on May 17, 2026 at 7:25 pm

    Watir is working correctly in that case. There is no special user-agent or anything used by Watir because plain old IE is used and it’s user-agent is sent by the IE itself of course.

    The reason why you cannot find the checkbox with Watir or from the HTML is that the checkbox is in a frame 🙂 Look for a frame tag in that html and you can understand why you were not able to find it before.

    You can access it from the frame instead:

    b.frame(:id, "download-frame").checkbox(:name, "21.1.9.12.3.1.3.0").clear
    

    If you’re getting access denied errors when trying to access frames, then just read the instructions at http://wiki.openqa.org/display/WTR/Frames

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, I read this thread to figure out how to generate HTML with JavaScript.
I try to read out all existing calendars. I want have a HashMap with
I try to read out all existing calendars. I tried the example from here:
I'm trying to have Screenreaders (I'm testing with NVDA) read out the AutomationProperties.Name and
I have an array of Paths which i want to read out with Template
i`ve got a little problem with LINQ. I read out some information via XML-RPC.
I am a beginner. I am making an education app which will read out
I'm trying to read data out of a database I created, but I always
I just can't realize why my read time out is not working. All I
Before you start marking this as a duplicate , read me out. The other

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.