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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:01:29+00:00 2026-06-13T12:01:29+00:00

I am using almost the exact same setup of Jeff Morgan’s book Cucumber &

  • 0

I am using almost the exact same setup of Jeff Morgan’s book “Cucumber & Cheese” and I have a page object with like this

class NewPublicationPage
  include PageObject
  include RSpec::Matchers
  ... 
  def submit_basic_message_with_tag
    @tag = Time.now.to_i
    ...
    self.tag_entry = @tag
    # the tag ends up getting added later on down the road to a div container.
    ...
  end

  def verify_last_tag
    done_loading
    # tag_list is a div container that should contain the tag.
    tag_list.should include @tag
  end
end

When I run the following commands in Cucumber steps, each command with its own step, it fails saying cannot convert nil to string. I know it has to do with the instance variable @tag, but I’m not sure why.

When /^I submit a basic message with tags$/ do
  on_page(NewPublicationPage).submit_basic_message_with_tag
end

Then /^I should see the tag under Publish History$/ do
    visit_page(PublishHistoryPage) # goes to page with div container that holds tags
    on_page(NewPublicationPage).verify_last_tag #this creates the error
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-13T12:01:30+00:00Added an answer on June 13, 2026 at 12:01 pm

    But anyway, you just need to set the @tag before trying to read it. So for instance you could set it at the beginning of the verify_last_tag method, or if you need it to be the same in both tests, you can take a look at that post
    I’m no expert with cucumber so I can’t really help you.

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

Sidebar

Related Questions

First, my teammate is successfully deploying on almost exactly the same setup and using
I asked Almost this exact same question yesterday. Basically I have a css button
Here is my situation. I have an app that is composed almost entirely using
I have done a few projects lately using a Database Object super class which
I have almost the same problem as this unanswered question . The only difference
Imagine two classes which share almost the same exact methods and properties, both extending
I'm (almost) successfully using Node.js with Express and Redis to handle sessions. The problem
I've been using px for almost all the measurement related styling, but I wanted
I'm creating an easy GUI using GridBagLayout and almost everything goes right, but there
I put together a mobile development stack that is almost entirely using Javascript on

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.