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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:36:39+00:00 2026-06-07T12:36:39+00:00

I use this code to submit a form using cucumber When I fill in

  • 0

I use this code to submit a form using cucumber

When I fill in "Email" with "example@example.com"
And I fill in "Name" with "user name"

Now I want to fill value in a select box.How can I do that?

  • 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-07T12:36:43+00:00Added an answer on June 7, 2026 at 12:36 pm

    That’s not code, those are cucumber feature statements. Cucumber will translate those into step definitions, which in turn can contain code that will let you test the thing being described.

    You probably have something like web_steps.rb that provides a set of pre-built statements like this, but you should not use them. You should be describing the business behavior of the application you are building, not the low-level UI details. Instead you should write something like this

    Given I am on the registration page
    When I sign up
    Then I should be logged in automatically
    And I should see a message stating "Thank you for signing up!"
    

    This gives you an example of what you want to happen when someone signs up (They are logged in automatically and they are thanked for signing up). They way you have it now, you will have to change your specification to match the UI whenever you want to change the name of a field, and the specification should never change unless you are changing your business needs.

    So to answer your more technical question, the step definition would look something like this, based on webrat’s documentation

    fill_in 'email', :with => '123@example.com'
    fill_in 'name', :with => 'username'
    select 'free account'
    click_button 'Signup'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If the user manually clicks the 'submit' button, i use this code: if (isset($_POST['submit_findall']))
I am using this code to try and submit a value via form but
This is an example of the code am using. I use a modified version
I'm trying to submit a form using javascript. This is the code I've used
I use this code for upload image: http://vikaskanani.wordpress.com/2011/01/11/android-upload-image-or-file-using-http-post-multi-part/ I replaced bm = BitmapFactory.decodeFile(/data/data/fshizzle.com/files/image.jpg); and
I am trying to use link to submit a form using the following code:
I use this code: http://blogswizards.com/plugin-development/sliding-boxes-and-captions-with-jquery On a simple gallery site I am building. Specifically
I want to submit a form using submit(), and indeed it works fine when
My target site contains code like this <form> <input type=text name=suggest value=www.google.com> <input type=submit
I use this code to fill select options based on the first select. That

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.