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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:46:26+00:00 2026-05-27T13:46:26+00:00

I have some rails app, a view with a field, lets say its called

  • 0

I have some rails app, a view with a field, lets say its called ‘some_field’
I want to fill in in the field ‘”SOME_STRING_WITH_QUOTES”‘

How can I do this in cucumber?

When I fill in "some_field" with ""SOME_STRING""

When I fill in "some_field" with "\"SOME_STRING\""

dont work (the cucumber parser doesnt seem to approve)
What to do? Its not some sort of matcher, so a regex wont work neither

  • 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-27T13:46:26+00:00Added an answer on May 27, 2026 at 1:46 pm

    When you write a step in your cucumber scenario, Cucumber suggests you the standard regex to match text inside the double quotes (regular expression [^”]* means a sequence of 0 or more characters of any kind, except ” character). So for When I fill in "some_field" with: "SOME_STRING" it will suggest the following step definition:

    When /^I fill in "([^"]*)" with: "([^"]*)"$/ do |arg1, arg2|
        pending # express the regexp above with the code you wish you had
    end 
    

    But you are not forced to use this regex and free to write any matcher you want. For example the following matcher will match any string that follows after colon and ends at the line end (and this string may include quotes):

    When /^I fill in "([^"]*)" with: (.*)$/ do |field, value|
        pending # express the regexp above with the code you wish you had
    end
    

    Then your scenario step will look like this:

    When I fill in "some_field" with: "all " this ' text will ' be matched.
    

    Update

    You can also use Cucumber’s Multiline String in your Scenario step:

    When I fill in "some_field" with: 
      """
      your text " with double quotes
      """
    

    And then you won’t need to change step definition generated by Cucumber:

    When /^I fill in "([^"]*)" with:$/ do |arg1, string|
      pending # express the regexp above with the code you wish you had
    end
    

    Your string with quotes will be passed as a last argument. In my opinion this approach looks heavier than the first one.

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

Sidebar

Related Questions

I have some data that I want to store somewhere in my Rails app
I have already implemented some AJAX pagination in my Rails app by using the
I have a Rails app that will post some data to another Rails app.
I have a Rails app with some basic models. The website displays data retrieved
I have a rails app with some nested data that I'd like to export
I have a MySQL/Rails app that needs search. Here's some info about the data:
I have some PDF files in a public rails folder. I want to set
I have a Posts table in my Rails 3.0.10 app. I want to give
I have a rails app running on Heroku. I am using paperclip for some
I have managed to setup autocomplete field for my rails app. What I'm trying

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.