Error Handle Genesys Notifications API Web Socket Integration Testing

Hi,

My team wants to handle error scenarios and we're having issues triggering a web socket error in our application. Is there a way to do this on the chrome browser? We've tried using Chrome's dev tools setting the network to the offline preset in the network log tab, but this doesn't trigger Genesys' web socket's onerror callback.

There's nothing built into the product to allow you to force the socket to fail. What I've always done (for this case and simulating other connectivity failures) is to simply disconnect the computer from the network by unplugging the ethernet cable and turning off wifi.

We've also tried disconnecting from the network as well, but no errors or other information about the web socket shows up in our logs. The network log also doesn't show a web socket connecting to Genesys, but our console logs show genesys notifications from the web socket. Do you have any suggestions?

I assumed an unexpected connection loss would trigger an error, but it looks like that may not be the case. Per the WebSocket: error event docs, it suggests that being unable to send data could result in an error. I don't know how you'd force that to happen, but I wonder if it would fail in that way if you caused a connection loss and tried to send data afterwards.

Since none of the WebSocket code in your app is actually using Genesys-provided resources, you could connect your app to any WebSocket server you can find/write that is capable of triggering an error condition. While that doesn't test how Genesys behaves, it does test how your code behaves when the browser's WebSocket API raises an error.

1 Like

Thank you Tim, we will try this approach

Hello,

I just noticed this on the Dev Center WebSocket manual health check - which might help managing this scenario.

Regards,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.