Automated Testing Framework (ATF) - Record Query with "contains" issue

chrissquires1
Tera Guru

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?

5 REPLIES 5

Masha
Kilo Guru

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?




chrissquires1
Tera Guru

It returns the incident number's display value.


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:


find_real_file.png


Record Query (Step 2):


find_real_file.png


And here is the result:


find_real_file.png



Now I am curious why you are getting a different result


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?