Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Automated Test Framework error: "This step failed because a client-side Javascript error was detected". - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Automated Test Framework error: "This step failed because a client-side Javascript error was detected".
KB0623238

Automated Test Framework error: "This step failed because a client-side Javascript error was detected".


26016 Views Last updated : Jun 5, 2025 public Copy Permalink English (Original)
  • English (Original)
  • Japanese
KB Summary by Now Assist

Description

An Automated Test Framework test reported Failure, and its Test Result has a Step Result with the following summary:

This step failed because a client-side Javascript error was detected on the page being tested. See the logs and screenshots on the test result for details.

 

Steps to Reproduce

 

  1. Run an Automated Test Framework test that interacts with a form.

  2. Check the Test Results for this test, for a Step Result with the following Summary:
    This step failed because a client-side JavaScript error was detected on the page being tested. See the logs and screenshots on the test result for details.

This Step Result appears only on a step that interacts with the UI.

 

Workaround

This is expected behaviour. The Automated Test Framework is working correctly when it reports this error on the output of a Step Result during the test.

In the event of a browser Javascript error, the Automated Test Framework fails the test on the step that is being executed when it occurred. The purpose of this error message is to help developers and testers find customization issues on their instance that occurred while executing that test step.

Even though Client Scripts can fail silently on Javascript errors while executing procedures, the error may still impact data and the procedure being executed, so the Automated Test Framework considers these errors as a validation failure.

When an Automated Test Framework test fails in this manner it is reporting an error found on the page being tested. The following helps users identify the root cause of the error that page caused.
 
To identify and resolve script errors reported by the ATF:
  1. Open the developer tools browser console on the Client Test Runner page.
    • For information about how to open the browser console, see the following article: How do I open the JavaScript console in different browsers?
  2. Navigate to Automated Test Framework > Tests and run the test, so that it is picked up by the same Client Test Runner.
  3. After the test completes, review the browser window's console for script errors. JavaScript errors found in the console were caused by the page or pages being tested.
  4. If you can see the error, then try to identify and troubleshoot the problematic script, which may be on any of the following base system tables:
    • Client Script
    • UI Action
    • UI Macro (HTML script)
    • UI Page (HTML script)
    • UI Policy
    • UI Script
    • Tables that extend the above base system tables
  5. Review the script for errors and once it has been fixed, run your test again.

To track down what introduced the script error, you can review that script's version history from the Versions related list of that script record.

  • If you've customized a base system script, it's possible that during an upgrade of your instance, a base system version of that script - that had been changed in the upgraded ServiceNow release - was skipped, and that change needed to be propagated to the customization.

 

Client Script error examples

When a client script causes an error, the browser console displays an error similar to this:
***************************************************
A script has encountered an error in render events
TypeError: Cannot read property 'id' of undefined
Script ends. Continuing happily
***************************************************
[00:00:00.002] onLoad Modify Comments Label
In this case the client script Modify Comments Label caused the error.

Any other type of script error reports directly to the browser console without any formatting upon occurrence, i.e:

TypeError: callbacks[id] is undefined

 

Script resource links

In some cases the console error provides a link to the script resource file. Following this link may give context to which script had executed it, i.e.:

Uncaught ReferenceError: myobj is not defined
    at incident.do?sys_id=12345678901234567890123456789012
(anonymous) @ incident.do?sys_id=12345678901234567890123456789012  <---- LINK

 

Access to scripts

While identifying problematic scripts, be sure to have necessary permissions and check relevant domains if they're configured.

 

Related known problems on Service Catalog "use cart layout"

https://hi.service-now.com/kb_view.do?sysparm_article=KB0682516
https://hi.service-now.com/kb_view.do?sysparm_article=KB0656699

 


Related Problem: PRB1037062

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.