Test Automation is no different from any other tasks involving Computing systems. Computers do the task we directed them to do and not the task we wanted it to do.


Let us look at a scenario where one of the Test Cases you created didn't work as expected or showed a result different from what you expected.

For example, let's say you create a Test Case to test the login feature.

1. Go to URL

2. Enter username in username field

3. Enter password in password field

4. Click on Login button


In this case, the test would pass even if the login didn't work as long as all the steps worked. The reason is that it performed successfully all the steps it was told to. It clicked on the Login button successfully. You never told it to verify that the login worked.


If you need it to check whether the login was successful, you need to add a verification step to verify that a new page was loaded or a new element was added to the page post the login action. Something like this:
1. Go to URL

2. Enter username in username field

3. Enter password in password field

4. Click on Login button

5. Verify that the element Dashboard is present on the page


Now, you have instructed the tool that we need to verify that a specific element 'Dashboard' is present on page after the login steps. It will verify the presence of that element as wel and fail if that element is not present.