How to test Related List Records in ServiceNow ATF

krishnaram
Kilo Contributor

Hi All,

How can i test Related List Records through ATF. How can I access the tabs inside of the form and how can I create new records under related list so can you tell any workaround solution ??

Any help is appreciated.

Thanks,

Vamsi Krishna

8 REPLIES 8

georgimavrodiev
Mega Guru

Hello Vamsi,



I was dealing with the same issue last week.
Recently, I started a project which includes ATF. While learning and getting familiar with the ATF module of ServiceNow, I noticed that there is no option for me to access any UI Actions, related to Related Lists in the ATF steps. I read the whole official documentation, but I found nothing. Thus, I concluded with the statement that ATF tests cannot operate with Related Lists the same way as users.

As an outcome, I used another approach.
Basically, the Related Lists are another tables. I even may call them Relationship tables.
Thus, I created steps in my ATF test that access these other tables (Related Lists) and creating records directly in them.

I will give you an example: I was working on an ATF test against Normal Change Workflow:
- once the ATF test of mine fills in the Change Request form while it is in 'New' state -> it saves it;
- then, another step of my ATF test opens a 'CI Affected' form in task_ci table;
- there, I used another step to set values in the 'Task' field. Here, I putted the Change Request number which was created with previous steps in my ATF test;
- another set populates the 'Configuration Item' field;
- then, I used one other step to submit the new record (in the task_ci table);

The result was -> the 'Affected CIs' Related List of my Change Request record has been successfully populated!


You should always open a new form in the relationship table (the one of the Related List), fill it in and submit it. While filling the form you can connect it to the main record you are interested in. This way, you will basically populate the Related List you are looking for.

 

Mentioning the information above, I may advise you Vamsi to use the same way in order to work with Related Lists in ATF tests.

 

Best Regards,
Georgi Mavrodiev

IT Consultant,
Do IT Wise Ltd.

You may visit us in our Web Site: www.doitwise.com

Hi Georgi ,

When I tried your option then I got error that CI is not editable .Kindly suggest what to do .

 

Thanx & Regards 

Anupam Gupta

 

hi i want to write ATF test cases for incident table related list, please suggest me steps?

 

Hello Tera,

 

Do you find any solution for the question Related List for Incident, if yes kindly provide me solution