ATF: How to get values from a onChange Client script to "Set field values" step in ATF.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-17-2018 10:33 PM
I am trying to automate a custom catalog item created by us. And some values for the drop down are populated through a onChange and onLoad Client script. but unfortunately those values are not shown in the "Set field values" step in ATF.
What is the best solution for me to able to get values, if the values only exist during on form onLoad or onChange script? I know it will work if the options is manually added.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-23-2018 09:59 PM
Hi,
I didn't found appropriate code for client script but I think what you are trying to do you can do it via business rule and script include combination as well
check the below links for reference and let me know if you get stuck somewhere after following business rule and script include combo
https://docs.servicenow.com/bundle/london-application-development/page/administer/auto-test-framework/task/atf-use-script-include.html
And for other operation you can refer below links
https://docs.servicenow.com/bundle/london-application-development/page/administer/auto-test-framework/concept/atf-use-cases.html
Mark my ANSWER as CORRECT and HELPFUL if it helped
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-14-2020 01:03 PM
Did you ever find a solution to this? I am having the exact same problem.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-29-2020 02:54 PM
Hi,
If what you want to do is set the value of the variables in the Set Variable Values step and the value doesn't appear in the drop-down in the Set Variable Values step, you can create a Parameter with the value that you want and then assign the parameter value to the field in the Set Variable Values step.
Enable parameterized testing.
Add parameters for the variables you want to set.
Create a parameter set and put the values you want in the fields.
I hope I understood your problem correctly and that this solution works.
Thanks,
Cody