Reuse test for further steps without copying

danielaz
Tera Contributor

Hi there,

I am trying to find a way to reuse steps performed for a test (e.g. Impersonate, Open a New Form, Set Field Values, Submit a Form, Open an Existing Record) without copying the whole test into a new one. In our application we have to fill in a form with many data, then save it and then there are new options how to proceed with the record/form. I don't want to copy the test into another because then if there will be a change on the form field we will have to adapt all copied tests instead of only the original one.

How would you build up the tests in order to reach my goal of reusable testing? I did not find a way to use a return value from one test for another either. In between steps it is possible but coudnt find it in between tests. I am new to ATF so maybe i am using a completely wrong approach. Any ideas on how to go on?

 

Thx 😉

2 REPLIES 2

charliesdev
Giga Expert

Any luck finding a solution for this?   I tried creating a Test Template and adding it to a new Test, but that functionality seems weak (doesn't buy me much functionality).

danielaz
Tera Contributor

What I found helpful was to create customized test steps using System-Definition-Templates encapsulating the form's data: https://community.servicenow.com/community?id=community_question&sys_id=b9868725db1cdbc01dcaf3231f9619fb 

I created templates to insert a record and then to update it according to our process and created customized test steps referencing the template data. If you copy these tests you should be fine because data will be stored in a template and could be changed central if necessary later on. Should probably be combined with test templates in case the testing order/structure changes later on.. but didnt have time to look into this yet.