Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Sahi cannot connect to socket when using angular and node js framework

Hi,

I am trying to test our website that uses angular and Node.js to push content to a page. The socket library that is maintaining the connection is socket.io however I am experiencing socket connection errors, see below:

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/
connecting to socket default. /src/assets/js/modules/Socket.js:8
Socket: Attempting to reconnect to socket /src/assets/js/modules/Socket.js:44
Socket: Reconnecting to socket /src/assets/js/modules/Socket.js:48
Socket: Error in socket reconnect Error: xhr poll error {type: "TransportError", description: 204, stack: (...), message: "xhr poll error"}
description: 204
message: "xhr poll error"
stack: (...)
get stack: function () { [native code] }
set stack: function () { [native code] }
type: "TransportError"
__proto__: d

Can Sahi maintain socket connection? Do I need to apply any extra configuration?

Without using the sahi proxy, the website works fine and can connect to the socket.

Answers

  • The Solution to this problem was to add the following to the donot_download_urls.txt:
    .*socket[.]io.*

    This lead to another problem when replaying scripts, each step took about 2 to 4 minutes to complete due to the streaming content. The anser to this was to add the following to the userdata.properties file:
    xhr.wait_ready_states=2,3
  • The Solution to this problem was to add the following to the donot_download_urls.txt:
    .*socket[.]io.*

    This lead to another problem when replaying scripts, each step took about 2 to 4 minutes to complete due to the streaming content. The anser to this was to add the following to the userdata.properties file:
    xhr.wait_ready_states=2,3
  • The Solution to this problem was to add the following to the donot_download_urls.txt:
    .*socket[.]io.*

    This lead to another problem when replaying scripts, each step took about 2 to 4 minutes to complete due to the streaming content. The anser to this was to add the following to the userdata.properties file:
    xhr.wait_ready_states=2,3
Sign In or Register to comment.