×

Test Local Web Applications

Test Local Web Applications

While you are developing a web application, the application is usually served from your computer. As a result, cross-browser and cross-device issues are usually tested only with those browsers installed on your machine and mobile emulators.

With webmate-connect, you can also test web sites and applications running from a local web server.

Installing webmate-connect

You run webmate Connect locally on your computer or on your local CI infrastructure. The binary can be downloaded here:

OS Link SHA-256 Check Sum
Windows Download 6bbb19969495eb08b1fc0bfb28e0769e334b909cc5c442890dc56ab1c34a9446
Mac Download cfdaa2ffd82001c48fe3313c5571d209649ba6df2a844be755bc8c43f410f037
Linux Download b656863f8cb32f7c756a338a5fa1abf85ee2318ff661ee1ee0358d9c18d8a5bd

If you are on Linux or macOS, you need to make the downloaded file executable by running chmod +x webmate-connect in your terminal.
On macOS you additionally need to go to the file’s parent folder using Finder, right-click on the file and select open from the context menu, then open again from the pop-up.
A terminal window should now open, which you can close again.
This is necessary to prevent the Gatekeeper feature in macOS from blocking the execution of webmate-mobilebridge from your terminal later on.

Example: Testing a Local Angular Application

Let’s say you develop a web application using the Angular framework and want to test your local development snapshot. You have started your Angular application with ng serve and it’s running on port 4200. In order to make the application available to webmate, you start webmate-connect as follows (this is for Mac, on Windows you would use webmate-connect-win.exe instead):

webmate-connect has now created a tunnel with the tunnel id tun30. You can access your application from webmate or from your automated test cases by using the URLs http://tun30.connect and https://tun30.connect. If you need a stable tunnel id, e.g., to use it within a test automation script, you can alternatively specify the tunnel id as a command parameter.

Example: Testing a Web Service in Your Local Network

Scenario: You want to test a web application that can be accessed in your local network. The application is protected with TLS/SSL.

This example uses the stable tunnel id named “mystabletunnelid”. After the connection has successfully started, your application is available at http(s)://mystabletunnelid.connect from within webmate. You can optionally set a host header, if this is required in your setup. If your application requires TLS/SSL, you must set the option --ssl.

Overview: Passing additional Arguments to webmate-connect

Here you will find an overview table of all arguments that can be passed to webmate-connect:

Argument Description Type
-v Enable verbose mode
--help Show the included help-text
--user REQUIRED: Specify your webmate user String
--api-key REQUIRED: Specify your webmate API-Key String
--ssl <true/false> Optional: If set to true, the tested server is assumed to speak TLS/SSL. No certificate verification will be done. Defaults to false. Boolean
--hostheader Optional: Use a specific host header when talking to the tested server. This may be important, when the tested server expects a specific host name, e.g. with name-based virtual hosts. By default, the hostname “localhost” is set. String
--header
Optional: Pass along a custom header for testing. By default, no custom header is used. String
--proxy Optional: Use a specified URL as a proxy. By default no proxy is used. String
--pid <true/false> Optional: If set to true, webmate-connect will generate a PID file. Defaults to false. Boolean
--keepalive Optional: Specify the interval of keep-alive messages in seconds that will be sent. Defaults to 0. Number
--max-retry-count Optional: Specify the maximum amount of retries for webmate-connect. By default, retries will be unlimited. Number
--max-retry-interval Optional: Specify the maximum interval for retries in seconds. Defaults to 0. Number
--server Optinal: Use a custom webmate-API-Endpoint to connect against. For example, as a Demo-Customer you should use https://demo.webmate.io/api/v1/connect/proxy. By default, https://app.webmate.io/api/v1/connect/proxy is used. String
×