ATF - Form vs. Server Test Steps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 04:01 AM
Hello, everyone!
What is the difference between Form Test Steps and Server Test Steps in ATF in ServiceNow?
When and why would we choose to use Form Test Steps (e.g., "Open a New Form," "Set Field Values," and "Submit a Form") over a single Server Test Step (e.g., "Record Insert") to insert a record? Considering that Server Test Steps are typically faster, in what scenarios would the three-step approach using Form Test Steps be preferred for creating records?
Additionally, in general, what types of scenarios are better suited to Form Test Steps rather than Server Test Steps?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 04:12 AM
Hi @kkrushkov
Form Test steps are meant to test form behavior. Think about things like which fields are visible, mandatory, read only on each view... Are Client Scripts working as expected... When I change the State of an incident to closed, are the right fields set to read only, for example. Those kinds of tests that involve the UI need to be done through Form test steps.
Server test steps would test server-side code, like Insert or Update based business rules, Flows, generated notifications, etc.
You are correct that Server test steps run faster, so it is best to use Form tests ONLY for testing form behavior. For instance, if you want to test if a business rule triggered by an update is working, you should NOT open a form, fill in the fields, submit it and then test the business rule. In this case you can do an update through a server side record update and then test the business rule. There is no need to go through the overhead of opening and filling out the form because the BR behavior should be the same regardless of how the record is updated.
The general rule of thumb is if you can test something through a server-side step, you should. It all comes down to what it is you are trying to validate.