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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:09:23+00:00 2026-06-17T02:09:23+00:00

I have an app that displays some content and then selects a random record

  • 0

I have an app that displays some content and then selects a random record and shows it

How do I test for this?

Then /^I Should see the associated "([^']*)" "([^']*)"$/ do |type, elements|
    elements.split(', ').each do |element|
        page.should have_content element
    end
end

obviously fails as it doesn’t find every record. How do I validate the presence of only one record??

Thanks

  • 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-17T02:09:24+00:00Added an answer on June 17, 2026 at 2:09 am

    Use the following:

    Then /^I should see the associated "([^"]*)" "([^"]*)"$/ do |type, elements|
      found = false
      elements.split(', ').each do |element|
        found = true if page.has_content? element
      end
      found.should == true
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an App that downloads and displays images from URL's. This works fine
I have a test winforms app with ThreadExceptionHandler that displays a message box when
I have an App that displays thousands of Pin annotations on a google map
I have an app that displays a splash screen. The splash screen activity creates
I have an app that displays 9 UIImageViews, and I'm adding in the ability
I have an app that displays 9 UIImageViews, and I'm trying to add in
I have a winforms app that initially displays a window with two file dialog
We have a backbone.js app that displays a number of forms to the user.
I have a listbox for a Windows Phone 7 app that displays info parsed
I'm developing an app that should allow the client to add several content sections

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.