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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:33:35+00:00 2026-06-14T07:33:35+00:00

I’m working on a Rails 3 application with Cucumber 1.1.1 and I’m trying to

  • 0

I’m working on a Rails 3 application with Cucumber 1.1.1 and I’m trying to select multiple checkboxes in my cucumber scenarios.

Here is my multiple checkboxes in haml:

- for diocese in Diocese.all
  = check_box_tag "clergy[diocese_ids][]", diocese.id, @clergy.dioceses.include?(diocese)
  = f.label diocese.name
  %br 

Here is my cucumber step

When /^I check the (\d+)(st|nd|rd|th) of the "([^"]*)" checkboxes$/ do |index, junk, group|
  page.all("input[id=\"clergy_diocese_ids_\"]")[index.to_i - 1].check('clergy_diocese_ids_') 
end

Here is my cucumber test:

  @wip
  Scenario: New Clergy
    Given I am on the clergies page
    When I follow "New Clergy"
    And I fill in "Surname" with "Wells"
    And I fill in "Given names" with "Robin"
    And I check the 1st of the "diocese" checkboxes
    And I check the 2nd of the "diocese" checkboxes
    And I press "Create Clergy"
    Then I should see "Clergy was successfully created."

The error I get when running my test:

    And I check the 1st of the "diocese" checkboxes                                    # fea
tures/step_definitions/clergy_steps.rb:37                                                  
      cannot check field, no checkbox with id, name, or label 'clergy_diocese_ids_' found (C
apybara::ElementNotFound)                                                                  
      ./features/step_definitions/clergy_steps.rb:38:in `/^I check the (\d+)(st|nd|rd|th) of
 the "([^"]*)" checkboxes$/'                                                               
      features/clergy_new.feature:17:in `And I check the 1st of the "diocese" checkboxes'

I’ve tried playing around with the page.all selector but I cannot work it out.

  • 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-14T07:33:36+00:00Added an answer on June 14, 2026 at 7:33 am

    As I understand it, its not the job of Cucumber to select checkboxes and interact with the UI. Cucumber parses the feature files and executes the corresponding step definitions that match. What you put in each step definition block is up to you.

    Since your step definition code appears to be using Capybara, I suggest viewing this solution.

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

Sidebar

Related Questions

I am trying to render a haml file in a javascript response like so:
I'm trying to select an H1 element which is the second-child in its group
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.