- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2019 11:33 PM
Hi,
when i click on UI action it will displays one Prompt box for user input, Now how can i pass value into Prompt box In ATF.
Any suggestions recommended .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2020 04:19 AM
Javascript prompt boxes, alert and confirm box cannot be tested via ATF
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2019 11:49 PM
Hello chanikya,
Automated Testing Framework does provide a way to test popups generated using GlideDialogWindow call that uses a UI Page to present the content of the pop-up or modal. The modal can be tested using the 'Click Modal Button' action. Please see this article for usage details: Form test step: Click Modal Button .
Form test step: Click a UI Action
Thank you
Mark it as correct/helpful if this helps you.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2019 11:53 PM
while we are not using any UI page script here,
So now how can i proceed with steps...
UI Actions Script is:
function AssignAsset(){
var openedFor = g_form.getReference('assigned_to');
if(!openedFor.sys_id > ''){
alert('Assigned to must be filled in before assigning assets.');
return;
} else {
var serNo = prompt("Enter the asset serial number");
if(serNo != null){
var asset = new GlideRecord('alm_hardware');
asset.addQuery('serial_number',serNo);
asset.query();
if(asset.next()){
asset.install_status = 1;
asset.update();
// double update to workaround existing rules that blank assigned to on state change
asset.assigned_to = openedFor.sys_id;
asset.update();
g_form.setValue('u_asset',asset.sys_id);
alert(serNo + " assigned to " + openedFor.u_display_name);
} else {
alert(serNo + " not found.");
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2019 02:09 AM
Try this,
prompt('Text you want to display','default_text'/variable)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2019 02:11 AM
do i have to use Server side script as a Step3?