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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:44:49+00:00 2026-05-26T20:44:49+00:00

So I’m using Watir WebDriver with both Firefox and Chrome. Chrome is much faster

  • 0

So I’m using Watir WebDriver with both Firefox and Chrome. Chrome is much faster but seems to have a number of eccentricities. First, in Firefox when I use something like:

ff.link(:text, "Click Here").exists?

It works fine. However, in Chrome it often seems to stall and then exit with a timeout exception. So what I’ve had to do is narrow the search in Chrome like this:

linkDiv = ch.div(:class, "mydiv")
linkDiv.link(:text, "Click Here").exists?

Typically this type of page reduction down to just the div tag of interest works just fine.

However, there is one other eccentricity I’ve noticed in Chrome that I haven’t noticed in Firefox. In Chrome, I occasionally get an Error 15 – something like no response on socket but since it is intermittent I can’t reproduce the error at will and haven’t copied the exact text down yet. I haven’t seen this in Firefox – at least not yet – but perhaps Chrome is giving me an error where Firefox hides it.

So I’d liked to be able to log when this error occurs and the best idea I’ve had so far is to use HTTP Codes – i.e. 200, 404, 500, etc. If the code is not 200 then record the code and try again.

Is there a way in Watir to get the HTTP code? Having come to Ruby from PHP/CURL I assumed there would be an easy way to get the HTTP code – something like browser.http_code (where browser = Watir::Browser.new :chrome, browser.goto(…)) but I haven’t found it yet and I haven’t had any luck finding a way online. The “solutions” I’ve found so far all entail other gems making a call to the page to get the returned code. However, since these pages work fine 10 times or more for every time I get this error making another call with another gem doesn’t help.

Thanks


My workaround…

The title of the intermittent page with nothing on it includes “is not available” at the end of the browser.title string. So I use a browser.title.include? "is not available" check to see if the page never loaded.

This is less than ideal for a lot of reasons like that title may change from site to site or may change when Chrome gets upgraded. Where as a status code of 200 will always tell my code there is a problem…

I guess it’s something to suggest to the developers.

Thanks again

  • 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-26T20:44:49+00:00Added an answer on May 26, 2026 at 8:44 pm

    Have you tried?

    browser.status
    

    The other thing would be to check on it the way the user would experience it, by looking at the resulting page, checking the title or text to see if it indicates an error.

    If that’s not what you are looking for, then you will need to use an HTTP level gem in addition to watir

    See this SO question and answer: Using Watir to check for bad links

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have just tried to save a simple *.rtf file with some websites and

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.