web_websocket_connect fuction fails with 500 error

  • KM02525219
  • 18-Aug-2016
  • 18-Aug-2016

Summary

web_websocket_connect fuction fails with 500 error due to incorrect headears.

Error

Replay of a script with websocket communication fails creating websocket at the step web_websocket_connect with the following error:

Action.c(xx): Error -26612: HTTP Status-Code=500 (Internal Server Error) for "ws://socketo.xx/xxx"  

Cause

Missing or extra headers are being sent during replay.

Fix

Compare recording and replay and make sure that only the heades which were sent during recording are being sent during replay.

Add the missing headers using the function web_add_header and remove the ones which are not needed with the function web_remove_auto_header for example.

web_add_header("Cache-Control","no-cache");
web_remove_auto_header("Referer",LAST);
web_remove_auto_header("Accept-Encoding",LAST);