ATF - how to open an related list record using ATF

Jk_
Tera Contributor

Hi All,

How to open an related list record using ATF.

find_real_file.png

 

Have written test step like below, but it's getting failed

find_real_file.png

 

find_real_file.png

 

5 REPLIES 5

Alok Gupta5
Tera Guru
Tera Guru

Hello,

You may achieve this via the following way -> let's imagine that you have an already created Problem record, which 'Number' is PRB0040001. In order to populate its 'Incident' Related List, you may perform the following:
- add additional steps to your ATF test that will access the specific Related List table;
- in our case, this is the incident table: incident;
- so, add the following steps:
1. Open a New Form (open incident table);
2. Set Field Values (populate the incident form fields. Here the most important one is to populate the 'Problem' field of the incident with the number of your problem record);
3. Submit a Form (submit the current incident form);
- as a result, a new incident record will be created, which will be linked to your problem record and by this: the 'Incident' Related List of the problem will be populated, as you are looking for;

I may add that once you modify your current ATF test with the steps I mentioned above, you can confirm everything was executed properly by adding one more step at the end of the test: Open an Existing Record (here, set the ATF test to open the main record (Problem)). Then, run the test and monitor it via the test executioner. There, you will be able to see that the 'Incident' Related List of the Problem gets populated correctly, while the test is still running.

 

In other words: in order to operate with Related Lists via ATF tests, you need to configure the ATF test to access the relationship table (the one of the Related List) and to perform the respective actions in order to link the record with the main record of yours.


Hope the above information will be of use to you!

 

Regards,
Alok Gupta

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you cannot do this directly

possibly you need to use run server side script and get the record sys_id and then use Open an Existing record step and output from previous script step

Regards
Ankur

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

@Jk_ 

Hope you are doing good.

Did my reply answer your question?

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

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

@Jk_ 

Hope you are doing good.

Did my reply answer your question?

Would you mind marking the best matching answer as correct and helpful, to close this thread so that it benefits future members?

Regards
Ankur

 

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