How can I add a record to a related list with ATF

mike275
Mega Expert

I have a custom app that has 2 tables.  One table is a one-to-many table.

In ATF, I have a test that adds a record to the parent table.

How do I then add a test step to open a form for the child record and carry on from there?

In other words, how do I make ATF click the "New" button below so I can make it set values on that form?

find_real_file.png

1 ACCEPTED SOLUTION

Giles Lewis
Giga Guru

I am assuming that your child form has a field which is a reference to the parent.

I am assuming that when you click the "New" button, it opens the child form, and the parent field is auto-populated. 

To test creation of a child record, use an "Open a New Form" step immediately followed by a "Set Field Values". The "Set Field Values" will specify the value of the parent by referencing the test step that created the parent record.

 

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

please check below links:

https://community.servicenow.com/community?id=community_question&sys_id=b4e96726db1e53c02328f3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=9aa3a0f1db14b3c413b5fb243996...

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Kajal Goti
Mega Guru

Hi,

 

Please visit below link,It would help you.

 

https://community.servicenow.com/community?id=community_question&sys_id=41a0dcafdba867c08e7c2926ca96...

 

Please mark as Correct,If it solves your issue,also mark as Helpfu.If you find any help worthy.

Giles Lewis
Giga Guru

I am assuming that your child form has a field which is a reference to the parent.

I am assuming that when you click the "New" button, it opens the child form, and the parent field is auto-populated. 

To test creation of a child record, use an "Open a New Form" step immediately followed by a "Set Field Values". The "Set Field Values" will specify the value of the parent by referencing the test step that created the parent record.

 

I don't want to have a field on the child form for the parent.

I can't set the value with ATF if the field is not on the form and editable, but I don't want my end-users to be able to muck with it.