Checking email notification for ATF? If I use the 'Create a User' step, is there a way to verify if an email notification has been sent for that user in ATF if a notification is supposed to be sent?

Justin1
Kilo Expert

Is there a way to test email notifications for a user I created in ATF?

1 ACCEPTED SOLUTION

Hi Justin,

I've encountered this exact scenario. Unfortunately, the 'Create a User' step does not let you set the user's email address. What I did to get around this was to use a 'Record Insert' step to insert a record into the sys_user table, where I set the user's email address. It does not have to be a realistic email address.

Then my email query was able to find the inserted user's fake email address under 'Recipients'.

ServiceNow ATF rolls back so my user record insert was rolled back/deleted at the end of my Test.

View solution in original post

6 REPLIES 6

Elijah Aromola
Mega Sage

Yes. You can query the sys_email table for records created relative past 1 minute that contain whatever identifiable information from that notification. For example, subject contains FIRST NAME. This is the only real way to query for emails sent out from ATF.

Hm I queried the sys_email table and found no email. However, when I set the recipient as an existing user, the email was generated...For the created user in ATF, is there no way for them to receive an email?

Hi Justin,

I've encountered this exact scenario. Unfortunately, the 'Create a User' step does not let you set the user's email address. What I did to get around this was to use a 'Record Insert' step to insert a record into the sys_user table, where I set the user's email address. It does not have to be a realistic email address.

Then my email query was able to find the inserted user's fake email address under 'Recipients'.

ServiceNow ATF rolls back so my user record insert was rolled back/deleted at the end of my Test.

Ah, that would do it. Were you able to set roles and groups for the user as well?

edit: ah i can insert a record into sys_user_has_role with the created record from the earlier step