Rules in creating tests with Selenium IDE
Now that we have installed Selenium IDE and understand what it is, we can think about working through our first tests. There are a few things that you need to consider when creating your first test. These rules apply to any form of test automation but need to be adhered to, especially when creating tests against a user interface:
- Tests should always have a known starting point. In the context of Selenium, this can 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.
These rules, like most rules, can be broken. However, breaking them can mean that you may run into issues later on, and when you have hundreds, or even thousands of tests, these small issues can mean that large parts of a test suite are failing.
With these rules in mind, let's create our first Selenium IDE test.