title: UI automation testing with Selenium and NUnit Order of Tests Executions
body: <p>It's almost my beginning of Automation Testing so I would like to apologize if I cannot make you clear!</p>
  
  <p>So, after a two weeks of reading blogs about automation, I have decided to use <strong>NUNIT</strong> with <strong>Selenium Webdriver</strong> for UI Automation.</p>
  
  <p>My application is of enterprise level that has remaint under developement for 3 years. It is a project and portfolio management system.</p>
  
  <p>I have hundreds of pages and about 50% of which perform <strong>CRUD</strong> operations. </p>
  
  <p>I decided the following strucutre for my application:</p>
  
  <p><a href="https://i.stack.imgur.com/f1y17.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f1y17.jpg" alt="Project structure"></a></p>
  
  <p>I am using test data as JSON in following format and retrive this data to my view models:</p>
  
  <pre><code>[
    {
      "Name": "Finance",
      "Description": "division with complete test data",
      "Color": "#ff0000",
      "ExpectedStatus": {
        "WillBeAdded": true,
        "WillBeDeleted": true,
        "WillBeUpdated": true
      },
      "PerformableActions": {
        "ShouldAdd": true,
        "ShouldDelete": false,
        "ShouldUpdate": true
      }
    },
    {
      "Name": "IT",
      "Description": "IT projects",
      "Color": "pink",
      "ExpectedStatus": {
        "WillBeAdded": true,
        "WillBeDeleted": true,
        "WillBeUpdated": true
      },
      "PerformableActions": {
        "ShouldAdd": true,
        "ShouldDelete": false,
        "ShouldUpdate": true
      }
    },
    {
      "Name": "Business",
      "Description": "division with name and color name",
      "Color": "yellow",
      "ExpectedStatus": {
        "WillBeAdded": true,
        "WillBeDeleted": true,
        "WillBeUpdated": true
      },
      "PerformableActions": {
        "ShouldAdd": true,
        "ShouldDelete": false,
        "ShouldUpdate": true
      }
    },
    {
      "Name": "",
      "Description": "division without name and color name, should add white color",
      "Color": "",
      "ExpectedStatus": {
        "WillBeAdded": true,
        "WillBeDeleted": true,
        "WillBeUpdated": true
      },
      "PerformableActions": {
        "ShouldAdd": true,
        "ShouldDelete": true,
        "ShouldUpdate": true
      }
    },
    {
      "Name": "",
      "Description": "without name and color name and will not be added",
      "Color": "black",
      "ExpectedStatus": {
        "WillBeAdded": false,
        "WillBeDeleted": false,
        "WillBeUpdated": false
      },
      "PerformableActions": {
        "ShouldAdd": true,
        "ShouldDelete": false,
        "ShouldUpdate": false
      }
    }
  ]
  </code></pre>
  
  <p>I am here using two things: </p>
  
  <p><strong>1. PerformableActions</strong> i.e what actions can I perform by using this test case data. E.g shouldAdd means should this TestCase be performed for adding record, shouldDelete means should this testCase be run for deleting the record, similarly shouldUpdate runs.</p>
  
  <p><strong>2. ExpectedStatus</strong> i.e what will be the expected result of the test case, 
  WillBeAdded means would this data be added to grid. Similarly WillBeDeleted and WillBeUpdated work.</p>
  
  <p><strong>Questions:</strong></p>
  
  <p>1) I am using same test data for all the <strong>CUD</strong> operations, the reason for this is that I have to maintain the CUD flow in my app. Since only need to test UI so I am just assuming that Create, retrieve and delete will work in order.</p>
  
  <p>Is this the right way of doing testing in cases of CRUD operations?</p>
  
  <p>2) Think that I have to run all the tests in my project, it may be <strong>hundreds or thousands</strong>, How would I maintain order, since I can see the only possible way is to use <strong>Order</strong> attribute in <strong>NUNit</strong>. How can I use that or is there any alternate to test group of independent modules and dependent modules seperately?</p>