ATF: How to get values from a onChange Client script to "Set field values" step in ATF.

Ijaazops
Kilo Expert

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.

find_real_file.png

3 REPLIES 3

Ct111
Tera Sage

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

kurtbell1
Giga Expert

Did you ever find a solution to this?  I am having the exact same problem.

codycotulla
Tera Guru

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