ATF opening a record created by clicking UI action.

Srikanth Menava
Kilo Sage

Hello SNC,

 In to the story, I created an INC and on the incident i am clicking on UI-Action 'create outage' which has to create an outage record in cmdb_ci_outage. My test is running fine untill this step but the I am not able to open the record, I am getting the following error.

FAILURE: Failed to open the 'cmdb_ci_outage' form with id '371745b68762e550c540c916cebb35a4'
Table 'cmdb_ci_outage' does not have a record with id '371745b68762e550c540c916cebb35a4'

 

below(attached)is the test result,ATF-SNC.PNG

 

has anyone faced it, FYI, I build other steps and same approach worked for othr and not for this, can anyone tell why?

1 ACCEPTED SOLUTION

I was able to figure it out myself.I created a submit record step after clicking the UI action.

Then the record was saved to the data base and was able to query for the record.

I followed the below approach..

SrikanthMenava_0-1684347909901.png

My test was success now.

View solution in original post

18 REPLIES 18

Srikanth Menava
Kilo Sage

@Ankur Bawiskar 

I just checked the ACL's. ITIL role is sufficient for the users to open the outage record.

both the users created has ITIL role, PFB

SrikanthMenava_0-1683725012159.png

if the test is ran by me, I have admin role. SO role doesn't appear to be the problem.

Moreover I am able to open outage record on my browser where test is running on.

this is the error with no screenshot attached to the failed test.

"FAILURE: No records matching query:
Task number = INC0100981" (---> task number is the created inc)
Thats the reason I could not understand, 

@Srikanth Menava 

okay do this

1) try to open an existing outage record without record query and check if it can be opened

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yes sir, I tried that and it successfully opened an outage record, PFB screenshot.

SrikanthMenava_0-1683831647560.png

 

@Srikanth Menava 

did you check any query BR is restricting the atf user?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

hello @Ankur Bawiskar I dont see any query Business rules on outage table at all.

SrikanthMenava_0-1683904516776.png

and on incident table 

SrikanthMenava_1-1683904600101.png

I opened 1 st one 

restrictIncidents();
 
function restrictIncidents() {
if (!gs.hasRole("itil") && !gs.hasRole("sn_incident_read") && gs.isInteractive()) {
//Do NOT restrict Incidents if SPM premium plugin is active AND user has the service_viewer role.
if (GlidePluginManager.isActive('com.snc.spm') && gs.hasRole('service_viewer'))
            return;
var u = gs.getUserID();
current.addQuery("caller_id", u).addOrCondition("opened_by", u).addOrCondition("watch_list", "CONTAINS", u);
}
}
so gave service_viewer role to the ATF user 
still the same error --> 'FAILURE: No records matching query:
Task number = INC0101080'