Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, windows and java based applications. Get your 30 day free trial.

Discuss your Sahi Pro usage patterns, best practices, problems and solutions. Help others solve their problems and seek help from the community when needed. If you need specific support on your application, please email support @ sahipro.com

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.