Open alex4200 opened 6 years ago
Additional information:
In the browser console the following error is shown:
Firefox can’t establish a connection to the server at ws://localhost:8889/api/kernels/7e5ade90-3880-43c9-a383-9c11d32a5b70/channels?session_id=979ed84181164476b45c04a58b0ab195.
Maybe it has to do with websockets which are not supported by browsermobproxy
?
If browsermobproxy doesn't support websockets, Jupyter's not going to work with it.
There is a solution (workaround) as described here: https://softwarequalityweb.wordpress.com/2018/09/13/monitoring-network-traffic-in-automated-web-tests/
To debug
selenium
tests I am trying to use a proxy to record all request/responses communications. In particular, I am usingbrowsermob-proxy
(see here) which is running e.g. on port 8080.To recreate this error you have to have
browsermobproxy
running on port 8080 (checkout the bin package from here and start the binary withbrowsermob-proxy --port 8080 &
), some unimportantipynb
notebook (just as example) and the following python test script:which you can start using
python script.py
(or whatever you name it). Additional packages required and used:Used packages:
The code opens the main
jupyter
page and clicks on the Untitled notebook. If you do the steps by hand it works and thejupyter
notebook loads fine. If it is done with the script usingbrowsermob-proxy
, you will get a connection error:In what cases do I expect such a connection failed error? What is the server missing?
Also, in case of the connection issue, the notebook server prints the following additional lines:
which are not present if you run the test manually or without the proxy! So there must be something not working with the proxy, but what exactly...?