is there a location to test code/scripts

humblecommitted
Kilo Guru

hello community,

i had a quick question about testing scripts and codes,

is there a location within servicenow that we can input scripts and code to test its functionality i.e. lets say you have a script that you want to test in a workflow,   instead of running the item that triggers the work flow, just copy and paste the code to a test bed that will run the code to see if will get servicenow to do what you wanted the code to do i.e. creating an SR or run other workflows, notifications, etc.

1 ACCEPTED SOLUTION

The SN Nerd
Giga Sage
Giga Sage

Use XPlore from the ServiceNow Share page. This is by far the best tool to test scripts available.



Fix Scripts are a better option to Background Scripts in my opinion.


You can save them for re-use and run them in the background.



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

View solution in original post

12 REPLIES 12

No plugin is needed, you should have admin role and don't forget to elevate your roles.



As Paul mentioned fix scripts can also be used, you can use both based on requirement. If it is something about testing I prefer Background script , if it is to change or fix in production I prefer fix scripts.


hello bharath,



i did ensure my security role was enabled.



note: this was an helsinki upgrade from eureka


find_real_file.pngfind_real_file.png


The SN Nerd
Giga Sage
Giga Sage

Use XPlore from the ServiceNow Share page. This is by far the best tool to test scripts available.



Fix Scripts are a better option to Background Scripts in my opinion.


You can save them for re-use and run them in the background.



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

hello paul,



i reviewed the xplore tool and it looks like the HI account holder has to request it (which i am not ).



i did find the "fix scripts" app and will test it out on my instance.  



if your recommendation solves the question i ask, i will return and mark you solution as the answer.



thank you.


The SN Nerd
Giga Sage
Giga Sage

You could also consider using the Automated Test Framework to write Unit Tests for your code.



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022