ATF submitting a record producer doesn’t work

J_31
Kilo Sage

I am unable to submit a record producer in portal 

4 REPLIES 4

Josh Pirozzi
Kilo Sage

Hi @J_31,

 

Could you provide screenshots or the steps you've tried in the ATF Test?

Carlos Petrucio
Mega Sage

Hi @J_31 ,

Here’s a step-by-step guide to setting up an Automated Test Framework (ATF) in ServiceNow to test the submission of a Record Producer via the Service Portal.

 

Step 1: Enable ATF (if necessary)

If ATF is not enabled in your instance:

  1. Go to System Definition > Plugins
  2. Search for Automated Test Framework
  3. If it's disabled, activate the sn_atf plugin

Step 2: Create a New Test in ATF

  1. Navigate to: Automated Test Framework > Tests
  2. Click New to create a new test
  3. Fill in the fields:
    • Name: Test Record Producer via Service Portal
    • Active: True
    • Application: Select the correct scope
    • Test Runner: Client Test (since it involves the Service Portal UI)
  4. Click Submit

Step 3: Add Steps to the Test

Now, edit the test and add the required steps:

 

 

Start the Test in a Browser

  1. In the created test, click Add Test Step
  2. Select Open a new browser window
  3. Configure:
    • Test User: Select a user with access to the Service Portal
    • URL type: Relative
    • URL: /sp (or the URL of your specific Service Portal)
  4. Click Submit

 

Navigate to the Record Producer

  1. Click Add Test Step
  2. Select Open a Service Portal Page
  3. Configure:
    • Page type: Record Producer
    • Record Producer: Select the Record Producer to test
    • Wait for loading: (checked)
  4. Click Submit

 

Fill in the Form

  1. Click Add Test Step
  2. Select Set Variable Values on a Record Producer
  3. Configure:
    • Record Producer: Select the Record Producer
    • Add the fields you want to populate with test values

 

Submit the Form

  1. Click Add Test Step
  2. Select Submit a Record Producer Form
  3. Click Submit

 

Validate Record Creation

  1. Click Add Test Step
  2. Select Validate a Record was Created
  3. Configure:
    • Table: The table where the record should be created (e.g., sc_req_item)
    • Field to validate: A relevant field to confirm that the record was created correctly
    • Expected value: The expected value for the validated field
  4. Click Submit

Step 4: Run the Test

  1. In the created test, click Run Test
  2. Choose an available Test Runner
  3. Click Run and monitor the process

If the test fails, check the ATF logs to identify the issue.

 

If my answer helped you, remember to mark it as the correct answer and like it so that other users can find it and encourage us to continue answering.

Thank you !

 

- Carlos Petrucio

 

Carlos Petrucio
Mega Sage

@J_31 

Hello, I hope you are well.
Did you find a solution after following the step-by-step instructions?

Remember to mark it as correct so that other users can find it and encourage us to continue responding.

Thank you!

- Carlos Petruccio

Ankur Bawiskar
Tera Patron
Tera Patron

@J_31 

unless you share what you have configured we can't help.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader