Today we are proud to release our new Selenium Tunnel, which will enable you to run Selenium tests on your local computer and network infrastructure.
Whether you want to test on your local computer (localhost), on a staging server inside your LAN, or on a computer across VPN, our new Tunnel makes all of this possible in a secure and reliable way.
Our previous solution, a simple SSH remote port forwarding program, allowed for testing on a single local computer and was at times slow. With the new Tunnel, we provide a more robust and faster solution. Here are a few of its features:
- Run tests on your local computer, on computers inside your LAN or across VPN.
- Fast: we cache static content on our end of the tunnel to reduce traffic inside the tunnel
- Secure: when you start the Tunnel, a pristine VM server is booted just for you.
- Robust: full HTTP(s) support, coded in Java
- Easy: very simple setup
Run tests on your local computer
When running Selenium tests you might want to test against your local staging environment. Maybe you've updated some code or added a new feature and you want to make sure all regression tests still pass.
With the new Tunnel, you can easily test on http://localhost or http://10.0.1.5 without changing anything to your test code. The only thing you need to do is point your tests to http://127.0.0.1 port 4445 instead of http://hub.testingbot.com port 4444.
The Tunnel is a Java based program (jar) which contains our very own secure HTTP(s) proxy, which will relay requests to our grid. This way a browser on one of our instances can easily fetch webpages through the tunnel.
When booting the Tunnel, we boot up a fresh VM server just for you which is required to set up the tunnel. Booting this VM takes 45 seconds max.
After your tests are finished the tunnel and VM server will be destroyed.
At our end of the tunnel, we added an accelerator called Squid, which is used by a lot of trusted companies. Squid will keep a cache of the static content flowing through the tunnel and store it for the lifetime of the Tunnel.
When a test requests the same static content file multiple times it will never have to go through the tunnel as Squid will have it in its cache. This optimisation will make sure your Tunnel stays fast.
All the requests to and from our servers will pass through the Tunnel, which is based on SSH. The traffic flowing through your personal VM is only available to you.
When your tests are finished, the tunnel is destroyed together with everything on the VM server.
The Tunnel is built in Java with proven code and tests. We support both HTTP and HTTPS usage inside the tunnel.
Starting the tunnel happens with a simple command on the command line and offers options like verbose logging and fast-fail regexes.
Setting up the Tunnel is very easy. Download the JAR file from our website and run it on your command line:
java -jar testingbot-tunnel.jar API_KEY API_SECRET
All you need to do is replace the
API_SECRET with your own key and secret.
You should see "You may start your tests" when your Tunnel is ready.
To use your Tunnel, you need to modify the host and port inside your test file(s). Instead of using our grid on http://hub.testingbot.com and port 4444, you now need to run your tests on http://localhost and port 4445. This will make sure your commands flow through the secure Tunnel, reaching our Selenium grid.
If you have any questions or suggestions, please leave a comment or reach out to us via email. Download our Selenium Tunnel.