Popup window fields testing through service now ATF

Pradhi Mathan
Kilo Explorer

I'm trying to enter values in the below popup window fields by using the below ATF server side script.But it's not entering any values. 

find_real_file.png

var dialog = new GlideDialogWindow("popup window id");
var ag=g_form.getValue("XXX");
var rep=g_form.getValue("YYY");
dialog.setPreference("assignment_group", ag);
dialog.setPreference("representative", rep);

Any help is grateful.

 

 

4 REPLIES 4

Venkatasubraman
Tera Expert

Hi Pradhi,

Is there any specific reason for you to use server side script.

If there isn't any , try using "set field values" which is much more easier and straight forward.

Regards,

Venkat

Hi Venkat,

I already tried this using "set field values" step. But it's not passing any values in the popup window fields. That why I want to give a try with a server side script.

Regards,

Pradhi

ruthrav
Mega Guru

Hello Pradhi,

You need to use the 'Set Component Value' under Custom UI category. You need to first click on the 'Retrieve components' then you will be able to see the fields from the pop-up and then you will be able to populate the values. This will fetch the fields of type date and reference only.

Mohini4
Kilo Contributor

@ruthrav  - I tried using  'Set Component Value' under Custom UI category for the Risk assessment pop up on the change request screen - I have recorded response for each of the questions on the pop up window but when I run it 

I see the error message as "Step execution failed with error: Unable to get property 'ownerDocument' of undefined or null reference"