Skip to main content
Users
CloudPortalLogin
  • Powered byPowered by
Introduction to Sitecore Personalize
Managing accounts and system settings
Identifying guests
Introduction to experiments
Introduction to experiences
Decisioning
View dashboards
Developer Center
Connecting to an external system
Using client-side JavaScript
Using server-side JavaScript
AI in Personalize
Glossary
  • Sitecore Personalize
  • Developer Center
  • JS Modules
  • Test a JS module

Test a JS module

You can test the JS module by running it for a selected guest. We recommend testing the module before you publish it, to identify any errors and ensure optimal performance. After changing the code, re-test the module with the same guest to check the results.

Since the JS module is only part of a larger piece of functionality (for example, some functions imported into a programmable decision), you might prefer to copy the JS module code, paste it into a draft programmable decision, and test it there.

Team members with a User, Developer, or Admin role in Sitecore Cloud Portal can test a JS module.

To test a JS module:

  1. Open the JS module and click Edit Edit icon.

  2. In the code editor, click Test.

    The Test JS module dialog
  3. In the Test JS module dialog, you can test against the default guest's attributes, or click in the search box and choose Recent to select from a list of recently active guests or Bookmarks to select from a list of bookmarked guests. The system selects a guest who was recently active. You can search for a guest using, for example, an email address, other unique identifier or browser ID.

    Note

    If there is a guest whose data you often use when configuring or testing code, just click the star icon to bookmark the guest so you no longer have to search for them.

  4. Click Test. The module runs as it would in production, against the data of the selected guest. The output of the module displays on the Response tab.

Do you have some feedback for us?

If you have suggestions for improving this article,

Privacy policySitecore Trust CenterCopyright © 1999-2026 Sitecore