- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 07-29-2022 11:50 PM
This technique does require you have the Xplore: Developer Toolkit installed on your instance. With Xplore and Script Debugger I cannot remember the last time I had to use gs.log() to debug anything.
The example code snippet below provides all you need to test any Client Callable Script Include. Simply change the names and values being tested to suit your specific need.
var mockRequest = {
"sysparm_name": "getSubscriptionCount",
"sysparm_sys_id": "aea24ac2c611227101fe910c323fb00e",
getParameter: function (name) {
return this[name];
}
},
mockAjax = new SubscribedUserAjax(mockRequest);
mockAjax.process();
Step 1.
Set a Break Point in the Script Include being tested and Activate Script Debugger.
Step 2.
Open a tab for Xplore and paste in the code snippet.
Step 3.
Click "Run"
As a teaser, am thinking the topic of a follow up article will show how you can combine this technique with ATF for server-side coverage of your AJAX scripts. That's a not so subtle hint at increasing that Helpful number.
- 2,030 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Writing GlideAjax scripts no longer needs to be a baffling ordeal!