...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Status | ||||
---|---|---|---|---|
|
Table of Contents |
---|
Configuration
Client configuration in $HOME/.greenspector/config.yml
...
Code Block | ||
---|---|---|
| ||
gspt init -a <greenspectorApi> -p <privateToken> |
where:
greenspectorApi
is your GREENSPECTOR Server API URL (for example https://app.greenspector.com/api);privateToken
is your private token, available in the Preferences screen on your GREENSPECTOR Web Interface.
The file $HOME/.greenspector/config.yml should now exists.
...
This command will tell you whether your basic configuration and credentials are correct or not. If correct, you should have the message "Server pinged with success".
you can get these errors if you misconfigured your proxy:
Error | Cause |
---|---|
. because an auto detection of your browser is set, you, you can find | Bad port |
Error: Get "https://app.greenspector.com/api/ping": Proxy Authentication Required | Bad user or password |
Error: Get "https://app.greenspector.com/api/ping": proxyconnect tcp: dial tcp 149.202.59.166:3129: i/o timeout | Bad Host |
Error: parse "http://myuser:mypassword": invalid port ":mypassword" after host | Need to encode password |
Error: Get "https://app.greenspector.com/api/ping": proxyconnect tcp: tls: first record does not look like a TLS handshake | Bad protocol, use http instead of https or the opposite |
Tips:
If you do not know the proxy host of your office and your browser is configured automatically to discover the proxy, you can get the following file via your browser :
wpad.<domaine_local>/wpad.dat
Example : https://wpad.myorganisation.fr/wpad.dat
...
In order to be able to use all the features of the GREENSPECTOR CLI, you also need a configuration file in your current working folder ($CURRENT_FOLDER/.greenspector/config.yml). This file contains the following fields:
...
$CURRENT_FOLDER/.greenspector/config
...
.yml
Code Block | ||
---|---|---|
| ||
application: <name of the application> version: <version of the application> environment: <environment to run the tests on> platform: <platform of the environment (mobile in most cases)> os: <OS of the environment> version: <version of this OS> device: <device name of the environment> browsers: <list of browsers available on this environment> |
For example:
...
$CURRENT_FOLDER/.greenspector/config.yml
Code Block | ||
---|---|---|
| ||
application: MyFirstApplication version: 0.1.2 environment: platform: mobile os: android version: "7" device: nexus6 browsers: - chrome |
...
Before using meter
command, you have to define the application and the version you are working on by setting the configuration file in the current folder by following instructions in paragraph 43909160 CLI#Current working folder configuration in $CURRENT_FOLDER/.greenspector/config.yml.
Send measures
Use this subcommand to send the results files from the current folder to the server:
...
Before using testbench
command, you have to define the application and the version you are working on by setting the configuration file in the current folder by following instructions in paragraph 43909160 CLI#Current working folder configuration in $CURRENT_FOLDER/.greenspector/config.yml.
Set the environment
To use the testbench
command, you first need to set the environment for your project.
To do so, you should use this command:
...
4 - --networkMode: The network mode for the test. Values can be "WIFI", "4G", "3G" or "2G". (Default: WIFI). Optional Optional
5 - --report
: Automatically generate the test report in the .greenspector
folder and wait for the job to end. (Default: false). Optional
...
4 - --networkMode: The network mode for the test. Values can be "WIFI", "4G", "3G" or "2G". (Default: WIFI). Optional Optional
This command will send a measure request to the server. After this measure has run on the Power Test Bench/Cloud, you will find the results on the Web Interface.
...
1 - --apkFile
: The APK(s) to benchmark. (If set multiple times, all the APK will be installed but only the first one will be launched and monitored). The apk file could be a local path, a public URL or a package name to download from the PlayStore. Optional if the applications to benchmark are already installed on phone. This This option is deprecated, use --app.
2 - --apkFiles: The APK(s) to benchmark. (If set multiple times, all the APK will be installed but only the first one will be monitored). Mandatory option: Minimum 1. This This option is deprecated, use --app.
Run your custom functional tests on your app / website
...
4 - --monitoredPackage
: For each Android application you want to monitored, precise the name of the android package to get metrics about the process (process data, process CPU…). Probes can monitor multi package at a time. In this case, metrics are agreggated. For website, choose the browser where the tests runs (i.e. com.android.chrome
). Mandatory option: Minimum Minimum 1
5 - --iterations
: Number of iterations of measure you want. (Default: 1). Optional
...
7 - --extra:
Use to transmit extras parameters to your instrumentation with the format name=value (ie --extra annotation=com.greenspector.demo.test.MyAnnotation add the following parameters to your instrumentation -e annotation com.greenspector.demo.test.MyAnnotation). Thus you can filter your tests for example using those extras parameters : https://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner). It can also be used to fill parameters on GDSL file. (exemple --extra PARAMETERNAME="value" will replace all ${PARAMETERNAME} in the GDSL file by value). Optional Optional
8 - --networkMode: The network mode for the test. Values can be "WIFI", "4G", "3G" or "2G". (Default: WIFI).
Optional Optional
9 - --
disable-dumpsys: Disable Android System Monitoring. By default, this is enabled and will add one iteration to your job for more detailed metrics (Views, Activity, OpenSSL Sockets, ...). If you don't need these metrics, you can disable this iteration, it will reduce testing time.
10 - --
only-dumpsys: Run only a Android System Monitoring iteration. This iteration will only be able to retrieve Android System metrics (Views, Activity, OpenSSL Sockets, ...).
Some options are deprecated:
1 - --apkFile
: Precise the APKs you want to measure and the APKs which contain your functional tests to launch. Prefer separate APKs for your app and for your tests. The apk file could be a local path, a public URL or a package name to download from the PlayStore. This option is deprecated, use --app
1 - --apkFiles
: Precise the APKs you want to measure and the APKs which contain your functional tests to launch. Prefer separate APKs for your app and for your tests. This option is deprecated, use --app
2 - --testPackages
: For each APK containing functional tests you want to launch (i.e. UIAutomator or Espresso tests), precise the name of the android package (i.e. package in file AndroidManifest.xml). All tests in those Android packages will be launched. This option is deprecated, use --testPackage
3 - --monitoredPackages
: The package name of the Android application to monitor with the probes to get metrics about the process (process data, process CPU…). Probes can monitor only one package at a time. For website, choose the browser where the tests runs (i.e. com.android.chrome
). This option is deprecated, use --monitoredPackage
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|