Server side script - Javascript compiler exception: missing name after . operator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018 10:31 AM
Hi,
I have an ATF test which was running fine previously, and suddenly the server side script step starts to return me errors. Does anyone know what might be the cause?
This is a screenshot of the error I got:
and this is the code that is currently having the issue:
(function(outputs, steps, stepResult, assertEqual) {
// add test script here
var survey = new GlideRecord('task_survey');
survey.get(steps('7230cfd0db186f0076cfa3cc0b9619a6').first_record);
gs.info('user: ' + survey.sent_to.name);
if (survey.sent_to.hasRole('survey_reader')){
var rec = new GlideRecord('sys_user_has_role');
rec.addQuery('role.name', 'survey_reader');
rec.addQuery('user', survey.sent_to);
rec.query();
rec.delete();
var bool = survey.sent_to.hasRole('survey_reader');
gs.info('user has survey_reader role: ' + bool);
}
step.outputs.record_id = survey.sent_to;
step.outputs.table = 'sys_user';
})(outputs, steps, stepResult, assertEqual);
Thanks in advance,
Alice
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2018 08:07 AM
Hello Alice
I guess the issue is with the following lines
step.outputs.record_id = survey.sent_to;
step.outputs.table = 'sys_user';
You should change those lines to
outputs.record_id = survey.sent_to;
outputs.table = 'sys_user';
I believe you have written a few custom output variable (e.g.: first_record as used in the following steps)
survey.get(steps('7230cfd0db186f0076cfa3cc0b9619a6').first_record);