Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 07:06 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 09:51 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 09:14 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2024 01:08 AM
Hi @dwef , Can you please send the screenshot of the test step and the error your are getting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 10:26 PM
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.