Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

ATF Record not appearing in list

adaomoji
Tera Contributor

Hello all, I am testing a catalog item that generates a request for a laptop. When I manually test this item, after submitting the form, the record is saved in the Requests [sc_request] table successfully.

 

However, when I recreate this process using ATF, the error I get is: "FAILURE: Failed to open the record with id '' in the 'Request' list. Record is not present in the list". Below are the steps of my test

 

1. Create a User (HR, not impersonated)

2. Create a User 

3. Open a catalog item

4. Set variable values

5. Validate variable values

6. Order a catalog item

7. Impersonate (HR approver)

8. Navigate to Module ('Requests'  module in 'Service Catalog' Application)

9. Open a record in a list (Error)

 

Does anyone know how I can resolve this issue?

10 REPLIES 10

The table name is sc_request.

 

I find it strange that the error is not filling out the id number that I have referenced from the 'Order a catalog item' step.

The table is sc_requests.

 

I find it strange that the error message is not including the sys id that I have referenced from the step 'order a catalog item'.

@adaomoji I was able to create my own ATF Test Suite to mimic yours and was able to execute without issues.

 

EthanDavies_0-1700662788990.png

Make sure your open record in the list step looks like below.

EthanDavies_1-1700662805013.png

 

EthanDavies_2-1700662877761.png

 

From looking at your test steps again I think the issue is that the 'Test Laptop' user is not being set as the Requested for user on the sc_request record that gets created. Because the user is not the Requested for on the sc_request record, they cannot see it in the list. Your impersonation step of the user should probably be before you try to open the item - that way the user you are impersonating will be the 'Requested for' user on the sc_request. You can test easily if it is because of the impersonation or not by deactivating the impersonation step you have, I think it would run through the execution just fine.

@adaomoji please mark one of the answers posted by a community member for your question as correct. It will help others who have a similar question/issue find the answer in the future 🙂

Hello @Ethan Davies thanks for the feedback. I had to rework my test because when I would save the request, it changed my "requested for" field to the approver - even though I initially changed it in the Set Variable Values step. Otherwise your solution would have worked 🙂 Below are my revised steps.

adaomoji_0-1701080774147.png