Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

ATF – How to set dynamically populated Select Box variable in Service Portal?

kwija
Mega Contributor

Hi,

I’m working on an ATF test for a Service Catalog item in Service Portal and have an issue with the Set Variable Values (SP) test step.

The catalog item contains a Select Box variable called request_type_choices. The choices for this variable are not configured statically on the variable itself. They are populated dynamically by an existing Catalog Client Script.

When I configure the standard Set Variable Values (SP) ATF step, I cannot select any of these dynamically generated values.

The value is available on the actual Service Portal form, but it is not available when configuring the ATF step.

I cannot modify the existing Catalog Client Script, so I’m looking for an ATF-side solution.

kwija_0-1788853108499.png

 

 

5 REPLIES 5

Sardash
Tera Guru

@kwija - 

You need to use two separate "Set Variable Values(SP)" steps before proceeding with the remaining test actions.

Note: If a field depends on another field, configure and set the dependent fields in separate steps to ensure the values are populated correctly.

---------------------------------------------------------------------------------------------------------------------------------------------------

If my response helped, please mark it by selecting "Accept as Solution" and " Helpful."

kwija
Mega Contributor

@Sardash No, this is not the case. Field depends on Cat. item, not on another field.

Ankur Bawiskar
Tera Patron

@kwija 

that variable doesn't have choices in Question choices table?

share variable config screenshot

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar 

No, this variable is part of variable set used in couple different cat. items and it is dynamically loaded based to cat. item (different selections for different cat. items) and for that Catalog Client Script is used. So when user opens specific cat. item in service portal -> can see available choices, but when try to use Set Variable Values (SP) ATF step -> there are no choices (as in my screenshot above). I tried to create new Step Configuration but it is not possible to create new UI step. Here is Catalog Client Script:

kwija_0-1788872127451.png