title: How to use multiple assert in a test
body: <p>I have to work on a HTML page and verify the result (adding some texts, selecting some items from comboboxes, clicking on some button).</p>
  
  <p>For example action1, action2 and action3.</p>
  
  <p>After each action, I need to verify the result of the previous action. In QTP, we would use Report.Fail (Pass, warning) and go to the next action.</p>
  
  <p>Here in code UI, I'm using something like</p>
  
  <pre><code>try{
    Action1;
    Assert //some kind of assert
    Action2;
    Assert //some kind of assert
    Action3;
    Assert //some kind of assert
  }
  Catch (exception ex)
  {
    ...
    Assert.Fail()
  }
  </code></pre>
  
  <p>This works somehow but not perfect. The problem is, if I remove the <code>Assert.Fail</code> from <code>catch</code>, the test will be passed! Which is odd (even the previous assert caused to get into catch statement). On the other hand, If I keep the <code>assert.fail</code> in the catch statement, the test will fail, but the screen capture is not the right one (the screen capture will be taken by <code>assert.fail</code> but not the previous ones).</p>
  
  <p>So <strong>my 1st question</strong> is how can I use multiple asserts and if one of them fails, close the test in right way and mark the test as Failed?</p>
  
  <p>my <strong>2nd question</strong> is, is it possible to make a logical operation with assert? Lets assume that we have a condition which can be A or B (depending or run time case). Now how should I check with the assert the conditions? It should pass the test only, if the condition is A or B. In all other cases the test should fail.</p>
  
  <p>Thanks</p>