ATF - Select Box values from Client Script to Set Value Test Step

Stiips
Tera Contributor

Hi, I'm new to using the ATF in ServiceNow. Is it possible to set values from a Test Step manually? Scenario is I have one Select Box in the Form and options of it is added from an onChange Client Script. Hence, in ATF Test Step "
Set Variable Values (SP)" that Select Box field options is empty. Kindly suggest if possible or not. 

5 REPLIES 5

Brian Lancaster
Kilo Patron

So if I'm understanding you correctly you have to set the value of a different variable then a OnChange client script runs and Populates the dropdown. If this is correct try the following.

  1. Do a Set Variable Values (SP) and only set the variables that would cause the dropdown to populate.
  2. Do a second Set Variable Values (SP) and populate the dropdown and any other variables.

This should hopefully allow the client script to run.

Hi Brian,

I attempted the two-step Set Variable Values (SP) method. The first step works as expected, but in the second step, the dropdown for the other variable does not populate. It only displays "--None --" in the ATF configuration.

Could you please advise if there’s an additional setup required for dependent variables?

Regards, 

Anke

How do you have the dependent field setup to get the correct values based on the parent dropdown?

Hi Brian, 

We are using an onChange client script to dynamically populate choice values into a Select Box variable. This works as expected during normal catalog item submission. However, when executing the same steps in ATF, the dropdown values are not available in the Set Variable Values (SP) step.

Regards, 

Anke