Automated Testing Framework (ATF) - Record Query with "contains" issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2017 01:00 PM
Hello everyone,
We have been having a blast testing out the capabilities of ATF. One issue we have run into though is with Record Query and the "contains" filter option.
If we query, for example, the sys_email table looking for a result from a previous step (like an Incident number) in the subject line the query will fail.
However, if we use a server-side script to build a string that includes the result from the previous step that exactly matches the email subject line it will pass.
What's even more interesting is if we query with contains for just a string value (ie, Subject contains 'opened on your behalf') the query passes but returns a ton of results.
The goal is to limit the query to one and only one result while passing the incident number from a prior step.
The query looks something like this:
Subject contains {{Step 8: Run Server Side Script.Record}}
Where the Server Side script record_id is overridden with the display value of the incident record. This query will fail.
If we update the server side script to pass the full subject line (Incident INC000XXXX has been opened on your behalf) then the same query above will pass.
Has anyone else run into nuances like this with ATF?
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2017 03:15 PM
That is interesting. I have a similar scenario of using 'contains' in a Record Query step and it is working as expected. What exactly does {{Step 8: Run Server Side Script.Record}} return when you log it out : incident number or sys_id?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2017 05:32 AM
It returns the incident number's display value.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2017 02:15 PM
This is odd. What does your custom script look like?
Here is what I have and it is working as expected.
Server Side Script (Step 1). It returns the INC number as an output:
Record Query (Step 2):
And here is the result:
Now I am curious why you are getting a different result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2017 03:50 PM
So here's what I'm doing:
Query is on sys_email
Body text contains Step 10: Submit a Form.Record AND
Body text contains Ticket Escalation - Approval Request
The reason for the additional criteria is to distinguish from other Escalation notifications.
We are returning the correct display value (though the sys_id is contained in the body text as well) yet it won't pass.
Doing the same script in a Server Side Script Validation we find the match using an encoded query on sys_email.
Keep in mind we are current with our instance as of Patch 3a. Perhaps Patch 5 has some other surprises other than file extension on screenshots that are helping with your query?