- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 12:14 AM
Hi. I have a GlideAjax function within a client script. I need to test it, without having to replicate all the stuff via UI or browser. How can I test it? I couldn't figure a way for testing it via background script.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 01:04 AM
you can use javascript executor for this to call that glideAjax
Using the Javascript Executor to test client scripts
You can be on that form from where GlideAjax has to be initiated and then press Alt+Ctrl+Shift+j
It opens up a executor and you can access form values using g_form object and then invoke GlideAjax, write your code and Run the code
Something like this
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 12:36 AM
Hi @EKTA2 please check below link may help you
if my answer helps you mark helpful and accept solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 12:40 AM
Hello @EKTA2
- You can define the required inputs as variables and replicate the function logic in a background script.
- Since background script and the Script Include both execute on the server side, there should be no issues testing the logic in this way.
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 12:53 AM
Hi @EKTA2 ,
Whats the issue ? your GA is written in client script so it will get invoked once form load or onchange. you can check the behavior on form.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 01:04 AM
you can use javascript executor for this to call that glideAjax
Using the Javascript Executor to test client scripts
You can be on that form from where GlideAjax has to be initiated and then press Alt+Ctrl+Shift+j
It opens up a executor and you can access form values using g_form object and then invoke GlideAjax, write your code and Run the code
Something like this
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader