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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:58:30+00:00 2026-05-23T05:58:30+00:00

I am writing some unit tests in VS 2010 using Selenium and C#. I

  • 0

I am writing some unit tests in VS 2010 using Selenium and C#. I have a couple of test cases. For instance, some of my test cases are:

  1. Launch the website: http://localhost:8080. Verify the Sign on page is present. Enter Username and Password, and Log in.

  2. Check to see if Search tab is present. Click on Search tab. Verify the tabs Search Books, Search Images, and Search Web are present.

  3. Click on Search Books. Type “C-Sharp for Dummies”. Click Search. Verify appropriate results are returned.

Now, my question is: Is it a better idea to create separate classes for each of the above test cases or is it better to combine them to one class, and just have separate methods?

All three test cases are related to one another. By this I mean, executing #2 requires #1 to be complete first, and #3 requires #2 to complete first. If I make separate classes, I believe I will need to call the method in #1 in the class #2, and call methods in #1 and #2 in the class #3.

I am not so sure what would be a good idea for this. Thanks in advance.

  • 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-23T05:58:30+00:00Added an answer on May 23, 2026 at 5:58 am

    If you use something like NUnit to control your selenium testing then point 1 can be inside a SetUp as we can assume that all (or most) of your tests will need to log in to do anything. Since all your tests will fail if this fails it doesn’t really need independent testing.

    If you consider the interaction between point 2 and 3 there is some cross over and there is some independent testing.

    If you consider the crossover testing (clicking the Search Books link) point 3 depends on point 2 to run before it is run, thus there is no point having two separate tests, if test 2 fails then test 3 will always fail.

    In point 2 you are testing that three links appear, but in test 3 you are only clicking one of them thus point 2 could fail but point 3 succeed, thus they should be separate tests., however point 3 does not depend entirely on point 2.

    Personally you have two options, if you are also going to test “Search Images” and “Search Web” then you should not have point 2 at all. The assertion of the visibility of the link and the clicking of the link should all be melded into point 3.

    If you are not going to test “Search Images” and “Search Web” then it is fine to have point 2. However test 3 should not call point 2’s method as it tests extra functionality that point 3 does not care about. It should assume the “Search Books” link is there and click it independently of point 2.

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

Sidebar

Related Questions

I am writing unit tests in visual studio 2010. For test some functionality, I
I'm writing some ruby (not Rails) and using test/unit with shoulda to write tests.
I am writing unit tests for some of my code and have run into
I am writing some unit tests in Visual Studio 2010. I can run all
I'm writing some unit tests for an ASP.NET MVC controller that's using SubSonic3 generated
I'm writing some unit tests and I have a lot of functions of the
I had to start writing some unit tests, using QualityTools.UnitTestFramework, for a web service
I'm writing some Unit tests against a database, and we're using transactions to make
I am writing some unit tests using visual studio 2008 professional edition. I learned
I am writing some unit tests which I have simplified to the following: class

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.