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

  • Home
  • SEARCH
  • 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 9083645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:49:22+00:00 2026-06-16T20:49:22+00:00

How can I open more than one browser using my code-watir, for example via

  • 0

How can I open more than one browser using my code-watir, for example via a while loop from 0 to 10?

Here is my code:

require 'watir-webdriver'
require 'headless'
class Page
    @headless = Headless.new
    @headless.start
    @browser = Watir::Browser.start 'bit.ly/***'
    def self.get_connection

        puts "Browser started"  
        puts @browser.title
        @browser.driver.manage.timeouts.implicit_wait = 3 #3 seconds

        @browser.select_list(:name => 'ctl00$tresc$111').select_value('6')
        puts "Selected country"  
        @browser.select_list(:name => 'ctl00$tresc$222').wait_until_present
        @browser.select_list(:name => 'ctl00$tresc$333').select_value('95')
        puts "Selected city" 
    end

    def self.close_connection
        @browser.close
        @headless.destroy
    end
end

Page.get_connection
Page.close_connection

But how to do something like this?

while i < 10
Page.get_connection
end
  • 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-16T20:49:23+00:00Added an answer on June 16, 2026 at 8:49 pm

    This should open ten browsers:

    10.times {Watir::Browser.new}
    

    If you want to use the browsers later, you can put them in a hash:

    browsers = {}
    (0..9).each {|i| browsers[i] = Watir::Browser.new}
    browsers[0].goto "google.com"
    browsers[1].goto "yahoo.com"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm using macbook pro. idea 10 can open more than one window , but
My Problem is! I Want to open more than one Application in same Browser,But
The users of my web application may have more than one browser window open
How i can open one Popover Controller from another Popover Controller in iPad?I want
For example, when you open a file via C-x-C-f, you can TAB complete file
The question is a very simple one, can you have more than one index
I'm trying to open more than one link in different tabs in default android
Eclipse allows you to open more than one text editing window at a time
How can I add a post with more than one tag? I'm doing this.
I've a JSP/Servlet Web App that consist of more than one servlet (and some

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.