Automated test open a child record by parent record

pyuen
Kilo Contributor

Hi All,

After i created an incident, the incident task will be generated by a business rule.

The incident task 's are linked to the incident.

How can I open the incident task after the "Submit a Form" step ?

Say my testing script is following

1)Open a New Incident form

2)populate the incident caller and short description

3)Submit a Form

4)Open the existing incident task by the step 3's incident ID ?

6 REPLIES 6

I have succumbed to using a different approach on ATF. I use an open record versus creating a new one. This solves several issues, like being able to use the same record river and over without rollback. The second, being able to acess child tasks by number. After testing, the rollback simply puts the record back to its initial state. Makes testing a lot easier for me.  


joel_fischer
ServiceNow Employee
ServiceNow Employee

Hi Pat,



You can use Record Query step between steps 3 and 4 to find the incident task created by your incident business rule. Pass its output to Open an Existing Record step to load the task's form.



In the below example I pass the newly created incident from Submit a Form step to Record Query step with table set to task.



Let's say the business rule sets the newly created task's Parent to the current incident's sys_id. Then you can build a query of "task.parent is incident.sys_id" to find the task:


4_Record_Query.png



Then use Open an Existing Record step on task table to open the task found by that query.


5_Open_an_Existing_Record.png