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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:15:27+00:00 2026-05-30T18:15:27+00:00

A similar problem happened to me when I was doing an example problem. Capybara

  • 0

A similar problem happened to me when I was doing an example problem. Capybara was not picking the text that was there. In this Capybara is not picking the link for the object that is there. Am I missing something?

Error message:

When I click the link "Why is earth round?"            # features/step_definitions/queston_steps.rb:6
      no link with title, id or text 'Why is earth round?' found (Capybara::ElementNotFound)
      (eval):2:in `click_link'
      ./features/step_definitions/queston_steps.rb:7:in `/^I click the link "([^"]*)"$/'
      features/viewing_questions.feature:9:in `When I click the link "Why is earth round?"'

These are my test gems:

group :test, :development do
  gem 'rspec-rails'
end

group :test do
  gem 'cucumber-rails'
  gem 'capybara'
  gem 'database_cleaner'
  gem 'factory_girl'
  gem 'factory_girl_rails'
end

These are my codes.

Scenario:

Scenario: Listing questions
Given I am on the home page
And there is a question "Why is earth round?"
When I click the link "Why is earth round?"
Then I should be on the page for "Why is earth round?"
And I should see "Question: Why is earth round?"

Factory definition:

Factory.define(:queston) do |q|
  q.question "Why is earth round?"
end

Step definition:

Given /^there is a question "([^"]*)"$/ do |question|
  FactoryGirl.create(:queston, :question => question)
  #Queston.create(:question => question)
end

When /^I click the link "([^"]*)"$/ do |link|
  click_link(link)
end

View:

<ul>
    <% @questons.each do |queston| %>
        <li><%= link_to queston.question, queston %></li>
    <% end %>
</ul>

Queston is the model class and question is its attribute.

  • 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-30T18:15:28+00:00Added an answer on May 30, 2026 at 6:15 pm

    The problem was with my scenario. I have to simply declare the object first, like this:

    Scenario: Listing questions
    Given there is a question "Why is earth round?"
    And I am on the home page
    

    Instead of

    Scenario: Listing questions
    Given I am on the home page
    And there is a question "Why is earth round?"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a similar problem: Link Which was solved by calling GetAsyncKeyState(). While all
I saw that some others faced this similar problem. I have read and checked
I have a similar problem to this post . I need to display up
I notice this thread: Fastish Python/Jython IPC , and I have a similar problem,
I've got a problem similar to,but subtly different from, that described here (Loading assemblies
This problem is similar to when creating alternate colour table-rows, only we are dealing
This question is similar to another one I asked , but whereas in that
I do not know how many faces this problem. If I do programming in
This has never happened before. Never have I seen ANY of these warnings. There
I have a similar problem.This is a snippet of my source: FileWriter fstream =

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.