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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:17:29+00:00 2026-06-19T04:17:29+00:00

I am having a problem with writing a test scenario checking a validity of

  • 0

I am having a problem with writing a test scenario checking a validity of stations that will be added to a database. Can anyone provide me with an example showing how to write it correctly. Somehow I feel that ‘Scenario outline’ is not the correct way…

‘stations’ and ‘new_stations’ are complex types
I want to have ‘stations’ as already defined and check if each one of ‘new_stations’ can be added.

Scenario Outline: 
    Given We have <stations>
    And We are trying to add a station of the <new_stations> having the same id, the same name or the same code
    Then we should not be able to add it


# <stations>
        | Id | Code | Name     | Validity                      |
        | 1  | 1    | City 1   | from 2013-01-01 to 2013-04-01 |
        | 2  | 2    | City 2   | from 2013-03-15 to 2013-05-01 | 

# <new_stations>
        | Id | Code | Name   | Validity                      |
        | 1  | 234  | City 4 | from 2013-03-01 to 2013-07-01 |
        | 3  | 5    | City 1 | from 2013-03-01 to 2013-07-01 |
        | 4  | 2    | City 3 | from 2012-03-15 to 2013-07-15 | 

So none of ‘new_stations’ should be added

  • Id 1 because its Id is not unique
  • Id 3 because its Name is not unique
  • Id 4 because its Code is not unique
  • 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-19T04:17:30+00:00Added an answer on June 19, 2026 at 4:17 am

    I think you might be mixing up your manys.

    A scenario outline is used to describe the same scenario, but in a parameterised way so that values are injected in turn. That looks like the second table you have

    But your example reads like you need to inject many rows of data all at once for the known stations, so it will become (see tables)

    Scenario Outline: 
      Given We have 
        | Id | Code | Name     | Validity                      |
        | 1  | 1    | City 1   | from 2013-01-01 to 2013-04-01 |
        | 2  | 2    | City 2   | from 2013-03-15 to 2013-05-01 | 
      And We are trying to add a station <Id>, <Code>, <Name>, <Validity> 
      Then we should not be able to add it
    
    Examples:
        | Id | Code | Name   | Validity                      |
        | 1  | 234  | City 4 | from 2013-03-01 to 2013-07-01 |
        | 3  | 5    | City 1 | from 2013-03-01 to 2013-07-01 |
        | 4  | 2    | City 3 | from 2012-03-15 to 2013-07-15 | 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a strange problem with a simple test app I am writing
I am having problems with writing a test in rspec for will_paginate. The problem
I'm actually writing a templating tool that will be able to read a test
Currently I am writing Perl script that creates LoadRunner scenario, execute the test, collect
I'm having a problem writing to a file: FileInputStream fin; try { fin =
I am having a problem with a file i am writing too, basically what
I'm having a problem with getting a Ruby string substitution going. I'm writing a
I'm writing a web app, and I'm having a serious problem with too much
I'm having a problem writing a regular expression for matching HTML tags. I found
I am having an problem writing unit tests for an simple session wrapper. The

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.