How to retrive the submiited form in Automated test Framework?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2024 07:23 AM
As I am new to the ATF,
First step - Impersonate the user
Second Step - Create new incident form
Third Step- Set the all mandatory fields
Fourth Step - Submit the form
In the next steps I need to map the submitted incident form information ?
Can anyone please help me ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2024 07:52 AM
No, I am not attempting to send an email. I am just validating the email to confirm if it was received from the incident caller.
My question is how to get the caller name from the submitted form?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2024 09:13 AM - edited 06-15-2024 10:30 PM
Hi,
Sorry, I could not find a low-code way of doing this and so, I had to write a server script as part of the test. Please check the screenshots below.
I have added the Run Server Side Script step right after the Submit a form step.
Code to compare the email values. Added a comment to provide greater clarity.
Test result showing success.
(function(outputs, steps, params, stepResult, assertEqual) {
// add test script here
var incident_gr = new GlideRecord('incident');
if (incident_gr.get(steps('put_your_submit_form_step_sys_id').record_id))
var email = incident_gr.caller_id.email;
//gs.info(email);
var email_gr = new GlideRecord('sys_email');
email_gr.addQuery('instance', steps('put_your_submit_form_step_sys_id').record_id); // instance is the name for the 'Target' field and the sys_id here is for the Submit form step.
email_gr.addQuery('recipients', 'CONTAINS', email);
email_gr.query();
if (email_gr.next())
stepResult.setOutputMessage('success');
else
stepResult.setOutputMessage('failure');
})(outputs, steps, params, stepResult, assertEqual);
Let me know if this helped you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2024 10:27 PM
Thanks, In next steps I need to send the email reply to the instance from that caller ID using
In this from field, I need to set the caller mail id
Thanks