tags:

views:

36

answers:

2

Hello,

I would like to learn more about how to use Selenium IDE and RC for creating good automation tests. Is there anybody who is interested in sharing info. or discussing this? Especially for things like:

1) What's a good way to organize the UI tests? Right now I am executing these tests thru NUnit and that executes the tests in the order of their alphabetical names. Is there a better way. (I am writing the selenium scripts in C# and not java)

2) How are the results logged?

3) Modularizing the Selenium RC tests? I am having a problem here. Since I am executing my tests thru NUnit, the only way I could figure was to give IDs to the tests so that they get run in the right order. Also I am having to write all my tests one after the other in the textfixture class. Again is there a better way? I tried creating additional files but when I create tests there and select them to run in NUnit, it looks like the selenium server doesn't even get started.

4) What are the best practices for automation testing? Any pointers to any sites/books/ etc.?

These might seem very simple things but I've spent weeks trying to come up with better ways, so if somebody is willing to offer suggestions or input I'll really appreciate it!

Thanks!

+1  A: 

If your desires is to use Selenium then I can suggest instead use the TestPlan front-end instead of another language. In additional to a domain specific language it offers nice test case management. You can organize your tests into a nice hierarchy and it will execute all of them and report the results.

It takes care of a lot of details of launching Selenium and smooths over many difficulties in the RC API.

edA-qa mort-ora-y
Thanks, I'll look into it.
ATester
+4  A: 

I have answered each of the questions for you below.

  1. Tests shouldn't matter about the order that they run in. If you start worrying about that you are going to start introducing flakiness of tests. If you have to login with each test do so, if you need to register a number of users during your tests do so. Tests should always be able to run on their own.

  2. Nunit logs its results in a XML file. This will have a list of the passes and fails and is normally rendered in a pretty fashion by nearly all Continuous

  3. See my answer for http://stackoverflow.com/questions/3899051/best-practices-for-modularizing-selenium-rc-test-scripts

    • Tests should always have a known starting point. In the context of Selenium this could mean opening a certain page to start a workflow.
    • Tests should not have to rely on any other tests to run. If a test is going to add something do not have a separate test to delete it. This is to ensure that if something goes wrong in one test it will not mean you have a lot of unnecessary failures to check.
    • Tests should only test one thing at a time.
    • Tests should clean up after themselves.
AutomatedTester
Thanks for your well formulated and well formatted response!
ATester