Cert++
Close

Script debugger setup and breakpoint debugging for controllers

Key Takeaway

The Script Debugger signs in with a Business Manager user's username and password, so OAuth credentials alone are not enough to connect it. Put that username and password in your connection configuration, such as dw.json.

Breakpoint debugging lets you pause server-side script code while a request runs. While the code is paused, you can look at variable values and evaluate expressions instead of guessing from logs. A common setup uses Visual Studio Code with the Prophet debugger. You configure it through a launch.json file that points at a sandbox and at your local cartridges.

What the Script Debugger does

The Script Debugger is the B2C Commerce tool for setting breakpoints, viewing variables, and evaluating expressions in server-side scripts. Those scripts include the ones that run during controller requests.

The Script Debugger also has an API. The Script Debugger API is a JSON-based set of requests and responses managed through a REST servlet. Developers use this RESTful API to build applications that talk to the Script Debugger to set breakpoints, view variables, and evaluate expressions. The Script Debugger API isn't available on a Production instance.

Ana's account page shows the wrong first name for logged-in shoppers. She sets a breakpoint on the controller line that builds the greeting, then loads the page on her sandbox. The request pauses at that line. She looks at the variable values and evaluates an expression against the customer's profile. She sees that the code reads the last name field, so she fixes that line without adding any log statements.

B2C Commerce Developer Study Guide

Checklist progress

0/237Learned

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other B2C Commerce Developer studiers.