- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2020 01:27 PM
I need to create an ATF Run Server Side Script Step that outputs more than 80 characters. How do I create the custom output variable?
Solved! Go to Solution.
- Labels:
-
Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 12:40 AM
Hi Lance,
the Run Server Side script is out of the box test step; please avoid changing anything to it;
you can create your own custom step which would be server side; define as many input variables and output variables
What is your exact requirement? Are you saying you want custom step script to query some table and store some text which is more than 32 characters and you want to use that in the next step
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2020 01:45 PM
HI,
Not sure what you mean, but we can create or use output of that run script activity in our activities.
Example:
//
// // Test step 1 - add data
// var gr = new GlideRecord('sc_task');
// // this sample step's Step config has Output variables named table and record_id
// outputs.table = 'sc_task';
// outputs.record_id = gr.insert();
//
// // Test step 2 - access added data and validate
// // check that the record exists (or that business logic changed it)
// var gr = new GlideRecord("sc_task");
// gr.get(steps(PREVIOUS_STEP_SYS_ID).record_id);
// assertEqual({name: "task gr exists", shouldbe: true, value: gr.isValidRecord()});
//
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2020 01:59 PM
record_id has a 32 character limit and table has an 80 character limit. I need to output more data than that. I have seen where custom output variables are possible but I cannot figure out how.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 12:32 AM
Hi,
Yes what i will suggest is to put the stepResultOutput and then access that in your code by querying that stepResultOutput.
// stepResult.setOutputMessage: Log a message to step results after step executes.
// Can only be called once or will overwrite previous
// message
//
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 12:40 AM
Hi Lance,
the Run Server Side script is out of the box test step; please avoid changing anything to it;
you can create your own custom step which would be server side; define as many input variables and output variables
What is your exact requirement? Are you saying you want custom step script to query some table and store some text which is more than 32 characters and you want to use that in the next step
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader