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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:29:44+00:00 2026-05-20T12:29:44+00:00

I am new to Capybara testing and am having a few issues. I have

  • 0

I am new to Capybara testing and am having a few issues.

I have a scenario I am trying to run, and this is the step implementation:

When /^I select the signin link$/ do
  click_link 'Sign in'
end

I have tried to access this link with xpath, css, and tried the within implementation as well. Capybara cannot seem to find it, and returns a Capybara::ElementNotFound exception in all cases.

When I load the webpage without JavaScript, the link is not visible, and I’m wondering if this is why Capybara cannot find it. I found a trigger method, but am unsure how it works. Does anyone have a working example of trigger, or any other ideas for what I should do?

  • 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-20T12:29:45+00:00Added an answer on May 20, 2026 at 12:29 pm

    Are you using the selenium webdriver to run this test? It sounds like you are trying to run a scenario that requires javascript to see certain elements, without using a driver that supports javascript.

    In your .feature file all you have to do is add this line before the scenario:

    @javascript
    Scenario:  My Scenario
      When blah blah blah
      ...
    

    The @javascript tag tells capybara to use selenium-webdriver to run the test. It’ll fire up firefox and go through the test – allowing all javascript functionality to work. This slows tests down considerably so only use it when absolutely necessary to test ajax-y and javascript-y behavior.

    If that still doesn’t work you can use this step:

    Then show me the page
    When I select the signin link
    

    Which will open the page up for you in a new browser in that page’s current state for your inspecting pleasure.

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

Sidebar

Related Questions

New to javascript/jquery and having a hard time with using this or $(this) to
I'm currently trying to set up integration/acceptance testing for a new rails 3 application
New to Objective C. I have created a few directories which contain pdf files
New to Linux programming in general. I am trying to communicate with a kernel
Being new to test based development, this question has been bugging me. How much
I've swapped out Webrat for Capybara on a new Rails 3 project. I ran
New to DDD here and have a architecture question which should be a typical
My friend just shared me this new application and I pulled it from heroku
New to php and drupal. I set up drupal and trying to customize the
new to cakePHP and trying my first join. I've got one table called users

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.