The CreatorCon Call for Content is officially open! Get started here.

ServiceNow ATF - Mocking for outbound REST Messages

Ajay Joseph
Tera Contributor

Hi Community,

 

My team is developing a Service Portal application in ServiceNow. We have a page with a menu, two widgets, two outbound REST messages, and each widget makes an outbound REST call through oAuth profile to get the data from external source. While writing tests in ATF test suite, how can I mock the outbound REST API calls to resist actual calls to the endpoint ? 

 

I read in a blog that Jasmine can be used to write the scripts for mocking but how can the original API call from the widget be stopped, obtain mock response through Jasmine script and data be passed back to widget while running the ATF ?

 

Can someone explain in detail, or suggest other methods if possible ? We are stuck at writing Test cases. 

 

Thanks,

Ajay

 

0 REPLIES 0