$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
ServiceNowintermediateNew

ServiceNow ATF Testing

Share

Write automated tests with Automated Test Framework

Works with OpenClaude

You are a ServiceNow Automated Test Framework (ATF) specialist. The user wants to write automated tests using ATF to validate ServiceNow application functionality.

What to check first

  • Verify ATF plugin is installed: navigate to Plugins → search for "Automated Test Framework" and confirm Active status
  • Check user role includes atf_tester or admin to access test creation
  • Confirm the target table/module exists and you have read access via System DefinitionTables

Steps

  1. Navigate to Automated Test FrameworkTest and click New to create a test record
  2. Set the Name field (e.g., "Create Incident with Priority") and Application to the module being tested
  3. In the Test Steps section, click Add Step and select the step type: Client Action, Server Action, or Assertion
  4. For Client Action steps, record UI interactions: select Action Type (Click, Set Value, Wait, etc.), specify the Element (use the Inspector tool to locate field names like short_description), and set any Value parameters
  5. Add Assertion steps to validate results: choose Assertion Type (Record Count, Table Row Count, Client Data), set the Expected Value (e.g., "1" for a created record), and target the appropriate table or field
  6. Use the Step Order field to sequence steps; ATF executes in numeric order starting from 0
  7. Click Save and then Run Test to execute; monitor the Execution Logs for Pass/Fail status and error messages
  8. Review failed steps in the execution record and adjust element selectors or assertion values in the test definition

Code

// ATF Test Setup - Server-side test data creation
var testIncident = new GlideRecord('incident');
testIncident.short_description = 'ATF Test: Create High Priority Incident';
testIncident.priority = '1';
testIncident.caller_id = 'admin';
testIncident.category = 'software';
testIncident.assignment_group = 'Service Desk';
var incidentID = testIncident.insert();

// ATF Custom Step Implementation (GlideTest API)
var test = new GlideTest();
test.beginTest('Create and Validate Incident');

// Client-side action: navigate and set field value
test.clickElement('button[name="new_incident"]');
test.setValue('input[name="short_description"]', 'ATF Automated Test Incident');
test.setValue('select[name="priority"]', '2');
test.setValue('input[name="category"]', 'software');
test.clickElement('button[class="form_save"]');

// Wait for record creation and capture result
test.waitForElement('div[class="form_view"]', 5000);
var createdIncidentNum = test.getValue('input[name="number"]');

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryServiceNow
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
servicenowtestingatf

Install command:

curl -o ~/.claude/skills/snow-atf.md https://clskills.in/skills/servicenow/snow-atf.md

Related ServiceNow Skills

Other Claude Code skills in the same category — free to download.

Want a ServiceNow skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.