- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
This best practice only applies if you are working on the Istanbul or later release. When using the automated test framework, it is a good idea to build your test while you build your form and code. This best practice really only applies to testing your ServiceNow forms. Once you feel like you have the mandatory fields and default view identified and your data model pretty solid, you should create a test. I recommend doing one test per form (if possible). Some people will create a separate test per field and this is not recommended in my book. It takes a long time to start up and run these test, so I have learned to chain related test together using the steps within the Automated Testing Framework (ATF).
For example: Below is the form from a property management application. This form is specifically used for managing the properties I rent. You can see there is a mandatory field on Address, but there is also an UI policy that controls the visibility of the Parking under structure field. If the type field is switch to Single Family Home the parking under structure field goes away.
Now that my form is done and I have the behavior I expect, I can create one automated test for this page that will test the behavior of the entire form. (see below)
You can see here that I am creating a test that test the state of more than one field at a time. You should not have separate test for each field. That is overkill. For example, you should not have a separate test for testing the mandatory field of Address.
Here is the flow of my test.
There may be exceptions to this rule, especially if your form is very complex and is controlled with lots of scripting logic, etc, but the idea is to minimize the number of places you have to maintain code, test, and files. Simplicity is your friend.
- 988 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
