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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:20:23+00:00 2026-06-08T20:20:23+00:00

I am using Watir-webdriver and have both IE 32 bit and IE 64 bit

  • 0

I am using Watir-webdriver and have both IE 32 bit and IE 64 bit on my test machine. When I create a browser instance using

browser = Watir::Browser.new :ie

It opens IE 64 bit by default (which is in itself interesting as it is not the default browsers). I would like to be able to specify which version of IE (32 bit or 64 bit) I am targeting programmatically. Is this possible, and if so how can it be done.

  • 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-08T20:20:26+00:00Added an answer on June 8, 2026 at 8:20 pm

    Background

    Selenium-webdriver, which is what Watir-webdriver is using, determines the version to use by:

    “The driver supports running 32-bit and 64-bit versions of the browser. The choice of how to determine which “bit-ness” to use in launching the browser depends on which version of the IEDriverServer.exe is launched. If the 32-bit version of IEDriverServer.exe is launched, the 32-bit version of IE will be launched. Similarly, if the 64-bit version of IEDriverServer.exe is launched, the 64-bit version of IE will be launched.” – http://code.google.com/p/selenium/wiki/InternetExplorerDriver

    Presumably you have the 64bit version installed.

    Solution

    Selenium-webdriver is hardcoded to the file IEDriverServer.exe. The quickest solution might be to override this. Try the following:

    • Download/extract both of the IEDriverServer for 32bit and 64bit versions
    • Rename them to IEDriverServer32.exe and IEDriverServer64.exe respectively
    • Ensure that both are in your path somewhere
    • Use the following code to specify which version to use

    This is a pretty quick hack. I am sure is a more elegant solution.

    require 'rubygems'
    require 'watir-webdriver'
    
    #Specify your version - 32bit or 64bit
    version = '32bit'
    
    #Determine the binary to use
    case version
        when '32bit'
            $ie_binary = 'IEDriverServer32'
        when '64bit'
            $ie_binary = 'IEDriverServer64'
        else
            raise( "Invalid version - #{version}" )
    end
    
    #Override the method that determines the binary to get
    module Selenium
        module WebDriver
            module IE
                class Server
                    def self.get
                        binary = Platform.find_binary($ie_binary)
                        if binary
                            new(binary)
                        else
                            raise Error::WebDriverError,
                            "Unable to find standalone executable. Please download the IEDriverServer from http://code.google.com/p/selenium/downloads/list and place the executable on your PATH."
                        end
                    end
                end
            end
        end
    end
    
    browser = Watir::Browser.new :ie
    #=> Browser of your desired IE version should launch
    

    Update – Add a bit option

    So that you can more nicely determine which browser to use, you can add a ‘bit option’ when creating an IE window. This is nicer than above, though still hacky (ie global variable).

    require 'rubygems'
    require 'watir-webdriver'
    
    module Selenium
        module WebDriver
            module IE
                class Bridge
                    alias_method :old_initialize, :initialize
                    def initialize(opts = {})
                        $ie_binary = ''
                        case opts.delete(:bit)
                            when '32'
                                $ie_binary = 'IEDriverServer32'                     
                            when '64'
                                $ie_binary = 'IEDriverServer64'
                            else
                                $ie_binary = 'IEDriverServer'
                        end
    
                        old_initialize(opts)
                    end
                end
            end
        end
    end
    
    module Selenium
        module WebDriver
            module IE   
                class Server
                    def self.get                
                        binary = Platform.find_binary($ie_binary)
                        if binary
                            new(binary)
                        else
                            raise Error::WebDriverError,
                            "Unable to find standalone executable. Please download the IEDriverServer from http://code.google.com/p/selenium/downloads/list and place the executable on your PATH."
                        end
                    end
                end
            end
        end
    end
    
    #Open and close a IE 32bit browser
    browser = Watir::Browser.new :ie, {:bit => '32'}
    browser.close
    
    #Open and close a IE 64bit browser
    browser = Watir::Browser.new :ie, {:bit => '64'}
    browser.close
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new on Watir-webdriver. I have tried running watir-webdriver using Firefox on http://bit.ly/watir-example I
I have a facebook app which I'd like to test using Watir. The problem
So I'm using Watir WebDriver with both Firefox and Chrome. Chrome is much faster
I have a script running watir-webdriver(using Firefox 4.0) that needs to access a web
I'm using watir-webdriver to drive IE to test a website using a SSL certificate
I am using watir-webdriver (0.5.3) in a Cucumber (1.1.9) test. I am attempting to
I have several ruby watir-webdriver scripts I am using to automate downloading files from
I'm using Firefox 13 and Watir-webdriver on windows via Ruby 1.9.2 and porting some
I've written an rspec test using Watir against a web application and it's running
I am using watir-webdriver and am attempting to check the background-color of an HTML

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.