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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:12:53+00:00 2026-05-28T14:12:53+00:00

Using Rubygems and Watir I’m unable to select options from a second drop down.

  • 0

Using Rubygems and Watir

I’m unable to select options from a second drop down.
here is the code of the 2 drop downs

<select class="LocalUtility" name="Accounts[0][Local_Utility]" id="">
<select class="LocalUtility" name="Accounts[1][Local_Utility]" id="">

I’m able to select options from the 1st by using

browser.select_list(:class, 'LocalUtility').set ('value')

I tried to use index for the 2nd drop down (tried with 1,2)

browser.select_list(:index, 1).set ('value') 

And I cannot use the name because Ruby is throwing errors due to what I’m suspecting is that Ruby does not like the brackets [1][Local_Utility]

browser.select_list(:name 'Accounts[1][Local_Utility]').set ('value')

Is there a possible solution to this?

  • 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-28T14:12:53+00:00Added an answer on May 28, 2026 at 2:12 pm

    Try

    browser.select_list(:class => "LocalUtility", :index => 1).select("value")
    

    to set the value in the second select list.

    I’m surprised that the name doesn’t work though. There’s a potential typo in what you’ve supplied us with

    Try

    browser.select_list(:name => "Accounts[1][Local_Utility]").select("value")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using watir-webdriver to scrape from a page with nested table based layout.
Using the following code I am trying to scrape a call log from our
I'm using gem bundler (v.0.9.6) and Rails 2.3.5, rubygems 1.3.6 and ruby 1.8.7 (On
This is Rails 2.3.8, I am using Bundler 1.0.21 and RubyGems 1.6.2 on a
I'm using watir-webdriver with chrome to automate my tests and I'm kinda stuck now.
brandon$ bundle Fetching source index for http://rubygems.org/ Using rake (0.9.2.2) Using log4r (1.1.9) Using
I am using RubyGems version 1.3.7. I just pushed a bad gem to the
I am using simplegeo and the gem in rubygems.org is not up to date,
Here is my Gemfile source :rubygems gem 'rake', '0.9.2.2' gem 'sinatra' gem 'activerecord', '3.0.9'
I am trying to using watir in ruby, I am able open a browser,

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.