This page describes how to use the client software called "MagicConnect" to carry out tests in environments that cannot be accessed from the internet, such as in-house environments.
Introduction
- For more general information on testing private environments, see Testing in Private Environments.
- Testing with MagicConnect is for the enterprise plan and is currently a feature for limited organizations. If you have already contracted the enterprise plan and would like to use this feature, please contact our support team.
Table of contents
Overview of testing with MagicConnect
How it works in broad strokes
MagicConnect is a feature that allows access to the in-house environment when creating and running tests in a MagicPod cloud environment. Note that it is not associated with a local PC environment or an external cloud environment.
The basic mechanism is that a bi-directional connection is established by launching the client software called "MagicConnect" on a machine that has access to the in-house environment and connecting to MagicPod, which then accepts communication from cloud devices (including browsers). This mechanism allows cloud devices to connect to test environments that cannot be connected from the internet.
Advantages of using this feature
Without MagicConnect, a local PC environment is basically the choice for testing in an in-house environment, whereas with MagicConnect a cloud environment is available. There are two main advantages to using a cloud environment.
- Simplicity of setup: In order to test iOS and Android in a local PC environment, there are many tools that have to be set up locally, in addition to the MagicPod account, and there is a certain amount of management cost. With a cloud environment, users only need a browser to access MagicPod on their PC, making it very easy to start creating tests.
- Improved test creation convenience: In addition, a cloud environment also allows users to use Real-time simple tests feature, which makes test creation smoother than taking screen captures one by one locally and returning to the edit screen in MagicPod.
Supported environments
- Environments where tests are executed: All platforms running in a cloud environment are supported.
- iOS (Simulator)
- Android (Emulator)
- Browsers (Chrome, Edge, Firefox)
- Client (Environment in which MagicConnect runs): The following major operating systems are supported.
- Windows
- macOS
- Linux
Usage requirements
- Plan: Only the enterprise plan
- Range of shared connections: Only in a project. It is not possible to use connections from different projects within the same organization. In the same project, it is possible to use one connection at the same time, for example, one device for test creation and three devices for batch run. However, considering the load, it is recommended to limit the number of devices to around five per connection.
- Limitation on number of connections: No limit. As it is used in combination with cloud devices, the upper limit of the number of cloud devices is in effect the upper limit of the number of MagicConnect connections.
- Limitation on connections: You can connect to any location that can be accessed from the machine running MagicConnect, including in-house environments. However, due to system restrictions, you cannot connect to "localhost" and "127.0.0.1". If you want to access a server on your local machine, use a local IP address such as "192.168.1.10".
How to use
Downloading MagicConnect
The latest version of MagicConnect can be downloaded from this page. For Mac, Windows and Linux, please download the appropriate zip file for your operating system and unzip it before use.
Launching MagicConnect
Run the downloaded and unzipped MagicConnect from the command line. The commands are basically the same on any OS, but here is an example command on Linux. When starting up, you need to specify at least the organization name, project name, and user's API token. These can be specified as parameters or as environment variables. The <> part should be rewritten to suit your environment.
- When specifying by parameters
./MagicConnect -o <ORGANIZATION_NAME> -p <PROJECT_NAME> -t <API_TOKEN>
- When specifying by environment variables
export MAGICPOD_ORGANIZATION=<ORGANIZATION_NAME>
export MAGICPOD_PROJECT=<PROJECT_NAME>
export MAGICPOD_API_TOKEN=<API_TOKEN>
./MagicConnect
After start-up, it is OK if the established connection information is displayed as follows. The part "00ea1067-c980-44fd-b4cd-fb5ae2edca97" is the ID of the connection (MagicConnect ID).
[xxxx-xx-xx xx:xx:xx.xxx - INFO] Started MagicConenct (MagicConnect ID=00ea1067-c980-44fd-b4cd-fb5ae2edca97) for <ORGANIZATION_NAME>/<PROJECT_NAME>
In the example above, the MagicConnect ID is automatically generated, but you can also specify it yourself.
- When specifying by parameters
./MagicConnect -o <ORGANIZATION_NAME> -p <PROJECT_NAME> -t <API_TOKEN> -i <MAGICCONNECT_ID>
- When specifying by environment variables
export MAGICPOD_ORGANIZATION=<ORGANIZATION_NAME>
export MAGICPOD_PROJECT=<PROJECT_NAME>
export MAGICPOD_API_TOKEN=<API_TOKEN>
export MAGICCONNECT_ID=<MAGICCONNECT_ID>
./MagicConnect
Test creation and execution
To create and run tests using MagicConnect, configure the following settings on the Details tab of the test settings panel.
- MagicConnect: Use self-launched instance.
- MagicConnect ID: <Specify an automated or specified MagicConnect ID above.>
If only one MagicConnect is activated for a project, you can use an already activated connection without specifying a MagicConnect ID. However, it is basically better to specify some value, as other users may start another connection without knowing it, or use an existing connection without knowing it. (Only users with test case update rights to the project can start and use MagicConnect connections, so they cannot be used by unauthorized users without permission.)
Once set up, start the device using the "Launch" button for test creation and the "Run new batch" button for batch run.
For Android tests, it takes 2-3 minutes to start as the device needs to be restarted. Please also see the "Advanced options for MagicConnect" section on Android as there are other limitations.
How to use in a proxy environment
When you use a proxy to connect to the internet from the machine where MagicConnect is launched, you need additional settings. Currently, MagicConnect supports two types of proxies below.
- Proxy without authentication
- Proxy which requires Basic authentication
You can configure for a proxy by parameters or environment variables like other settings. We show an example for Basic authentication. If you need no authentication, please just specify "--proxy-server-url".
- When specifying by parameters
./MagicConnect <other required options> \
--proxy-server-url=<PROXY_SERVER_URL> \
--proxy-server-auth-type=basic \
--proxy-server-auth-user=<USER> \
--proxy-server-auth-password=<PASSWORD>
- When specifying by esnvironment variable
export MAGICCONNECT_PROXY_SERVER_URL=<PROXY_SERVER_URL>
export MAGICCONNECT_PROXY_SERVER_AUTH_TYPE=basic
export MAGICCONNECT_PROXY_SERVER_AUTH_USER=<USER>
export MAGICCONNECT_PROXY_SERVER_AUTH_PASSWORD=<PASSWORD>
./MagicConnect
Advanced options for MagicConnect
A list of parameters that can be specified for MagicConnect can be found by the following command.
./MagicConnect -h
NAME:
MagicConnect - Enables MagicPod testing within local testing environment
USAGE:
flags [global options] command [command options] [arguments...]
VERSION:
0.99.30.1
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--organization value, -o value Organization name. (Not "organization display name", be careful!) [$MAGICPOD_ORGANIZATION]
--project value, -p value Project name. (Not "project display name", be careful!) [$MAGICPOD_PROJECT]
--token value, -t value API token. You can get the value from https://app.magicpod.com/accounts/api-token/ [$MAGICPOD_API_TOKEN]
--id value, -i value (Optional) MagicConnect ID. When you launch multiple connections, you can identify them by this ID. [$MAGICCONNECT_ID]
--proxy-server-url value (Optional) Proxy server URL. [$MAGICCONNECT_PROXY_SERVER_URL]
--proxy-server-auth-type value (Optional) Authentication type of the proxy server, used with proxy-server-url. Supported values are none/basic. When not specified, regarded as none. [$MAGICCONNECT_PROXY_SERVER_AUTH_TYPE]
--proxy-server-auth-user value (Optional) User name when authenticating to the proxy. Effective only when proxy-server-auth-type is basic. [$MAGICCONNECT_PROXY_SERVER_AUTH_USER]
--proxy-server-auth-password value (Optional) Password when authenticating to the proxy. Effective only when proxy-server-auth-type is basic. [$MAGICCONNECT_PROXY_SERVER_AUTH_PASSWORD]
--android-dns-server 192.168.1.1, -d 192.168.1.1 (Optional) DNS server for the internal network. You can specify like 192.168.1.1 or `192.168.1.1:53`. If the port is not specified, it's regarded as 53. This option is effective only for Android cloud devices. [$MAGICCONNECT_DNS_SERVER]
--log-level value, -l value (Optional) Log level. Supported values are trace/debug/info/notice/warning/error/critical. (default: "info")
--force-create, -f (Optional) Delete the existing tunnel and create a new one when the Tunnel ID is already in use.
--help, -h show help
--version, -v print the version
Some non-mandatory parameters are explained here.
--android-dns-server, -d
As a restriction when using MagicConnect for Android testing, you need to specify the IP address of your in-house DNS server with this parameter in order to test on a domain for in-house use (Format like "test.example.local").
--log-level, -l
Specify the log level of MagicConnect. The default value is "info", which outputs minimal logs such as connection start and end. If the level is set to "debug", information on the domain or IP of the connection destination is output for each request. The amount of logging increases, but this information is useful if you want to check which connections are coming in.
--force-create, -f
If a MagicConnect connection with the same name has already been established, you can forcibly delete it and establish a new connection. Basically, a MagicConnect connection is deleted when a MagicConnect process is terminated, but if it is terminated due to an unexpected error and the connection remains, it can be reconnected with this feature.