2

This might seem a sily question to those who are well versed in autonmation but I am struggling with many things. Here's one:

I am finding that the tests I created with Selenium RC in Visual Studio 2008 are getting run from NUnit in the alphabetical order of their names?

What am I missing? Is there a way to organize the order in which the tests in Nunit are run?

Thanks!

Saavik
  • 93
  • 2
  • 7
  • 3
    possible duplicate of [NUnit Test Run Order](http://stackoverflow.com/questions/1078658/nunit-test-run-order). Note that all of the answers there suggest that your tests should not be order-dependent. Since that question doesn't offer a solution, I suggest that you simply put a numeric order at the beginning of each of your test names, so that they alphabetically sort in the order you expect them to run. – Robert Harvey Oct 20 '10 at 19:19
  • Just curious to know why you care about the order. – Larsenal Oct 20 '10 at 19:19
  • possible duplicate of [Unit test sequence when running all tests in solution](http://stackoverflow.com/questions/1823015/unit-test-sequence-when-running-all-tests-in-solution) – Jeff Sternal Oct 20 '10 at 19:27
  • 1
    AH, I forgot to mention I am executing UI tests and not unit tests. So these are tests created with Selenium RC. – Saavik Oct 20 '10 at 19:49

1 Answers1

0

Technically, your unit tests should all be able to run independently of each other so ordering should not matter.

I think it might be time to re-think how you are doing your tests.

If you just want them run in a specific order because that's how you "prefer" them to be run, then I would argue that you are throwing away precious time doing something that really isn't that important.

If you need specific things done before the tests are executed, check out the setup and teardown methods.

Robert Greiner
  • 29,049
  • 9
  • 65
  • 85
  • 2
    The problem is I am executing UI automation tests not unit tests. – Saavik Oct 20 '10 at 19:42
  • 9
    I just knew that for a very specific question with a specific answer the "top" answer will be someone questioning "design" decisions of a project they haven't even seen. NUnit doesn't have to be used just for unit tests. – Egor Pavlikhin Jul 05 '12 at 14:31