×

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: (The latest version of the binary is 1.0.8. You can find the version by running webmate-connect --version.)

OS Link SHA-256 Check Sum
Windows Download de6e1ee6992a4e80bc5b2ffdbf8e124af6b7523b6818b5e90cb5c4db2d2747ec
Mac Download a10518e035d4d95d598dd91f9c164d7dd2fee7c1378634d8d020d1cbc228729e
Linux Download 9c62833a7f392af0871aa4ccda796c3cea3b6fe1c20a1638e03a53fdf3b217b2

If you are on Linux or macOS, you need to make the downloaded file executable by running chmod +x webmate-connect-<your OS> 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 supports both types of webmate API keys. The traditional API key follows the UUID format, e.g. c1e3effb-xxx-xxx-xxx-xxx, and requires the inclusion of the --user (email) in the configuration. On the other hand, the new longer API key, e.g. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=, does not require the --user information.

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 Optional: 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 Optional: Use a custom webmate-API-Endpoint to connect against. By default, https://app.webmate.io/api/v1/connect/proxy is used. String
×