Automated Test Framework

dwef
Tera Contributor

When testing Change module via ATF (Automated Test Framework) in ServiceNow, filling mandatory fields like categories, subcategories, and target company is essential, but it is throwing error if I set any values for those and then submit .
errors: FAILURE: Failed to set field 'u_target_company' to value '0a6b9f36ec5330009d44fc8b024ccc04' because the reference is NOT valid - for target company field
Invalid insert - as these are dependent fields , u_subcategory - for subactegory fields 

 

help me to fill those and submit the form in ATF

5 REPLIES 5

Ujjwal019
Tera Guru

The error occurs because the fields are interdependent and reference data based on the values of other variables. To resolve this, try setting values in different steps. For Example, for the Category, SubCategory, and Target Company fields, create three separate test steps 'Set Field Values' and assign the interrelated values accordingly. 

 

 

Please mark my answer helpful if it helps you and accept it as a solution to assist the ServiceNow community.

dwef
Tera Contributor

Thanks much for your response.
But I am not able to resolve the issue , when I open the change form for category hardware , it is showing subcategory as hardware , but when I give the same while testing it is throwing error.
FAILURE: Unable to set field 'u_subcategory' to value 'Hardware'. Value 'Hardware' is not currently a valid choice

I tried with all subcategory choices it is not taking .
Kindly help me to pass this step .
Kind of urgent , so could you pls respond asap

Hi @dwef , Can you please send the screenshot of the test step and the error your are getting. 

SN_Learn
Kilo Patron
Kilo Patron

Hi @dwef ,

 

Please also check if the user is having access to that reference value of (u_target_company) or not. Check the below KB for more details:


ATF test fails with "reference is NOT valid" 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.