- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2018 07:33 PM
Hi guys,
I'm trying to create a Run Server Side Script to test one of my script include. But i'm still new with this ATF and don't know how to wirte it. This script below is one of my scipt include. PLs help me to write a run server script to test it !
var CalAge = Class.create();
CalAge.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
generateAge: function() {
var dob = this.getParameter('sysparam_id');
var today = new GlideDateTime();
var todayYear = today.getYearLocalTime();
var bday = new GlideDateTime(dob.toString());
var bdayYear = bday.getYearLocalTime();
var age =todayYear - bdayYear;
return age;
},
type: 'CalAge'
});
or this one
var EmailValid = Class.create();
EmailValid.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
isEmailValid: function(email){
var getEmail = this.getParameter('sysparm_id') || email;
var regex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,}/;
return regex.test(getEmail);
},
type: 'EmailValid'
});
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2018 09:48 PM
Hi escanor,
I understand you are trying to test the script Include. The script include what you have written is used to call in client-scripts. How ever you can test the same in the background script, by writing the following code. I did that and could get some result.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2018 07:38 PM
Do you want to call it from a client script? These scripts seems to be Client callable script include
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2018 07:42 PM
yeah dude. I created it for validating some fields of my application form. And now i want to write a test script for it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2018 09:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2018 09:48 PM