Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Current »

In this section, you will find how to launch a functional journey analysis on a local android device as it has been described in the Getting started part.

Preparation

Settings

In the display options :

  • Configure brightness adaptation in manual mode

  • Set phone sleep timer to maximum

In the language settings :

  • If possible, set the language to 'English - United Kingdom

Validate access to your application

On your local smartphone, check that you can use your application correctly: the mobile application reaches all your servers, and your web application accesses all your web services, which are necessary for it to work properly.

Having an accessible application, a smartphone and a Google account linked to the Play Store set up in English (United Kingdom) are the prerequisites for carrying out a measurement.

[Optional] Create an application on the Greenspector App

If it is not done and you want to save measures on the web interface, create an application on Greenspector App

  • Go to the Applications menu

  • Click on Add an application

  • Enter a name, a first version and description (not obligatory)

  • Validate

Complete files

To launch tests, the testrunner executable needs config and job files. For more information about the content of these files, check the section Complementary files (Android).

You will need some information to launch functional journey analysis on local device :

Modification of config.yml file

Edit the config.yml file you have just downloaded, replace :

  • ${PHONE_IP} by your phone's IP address

  • ${PHONE_PORT} by 5555

  • ${PATH_TO_ADB} by the path to the adb executable. Simply write "adb" if this command is already in your environment variables.

  • ${PATH_TO_AAPT} by the path of the aapt executable. Simply write "aapt" if this command is already in your environment variables.

  • ${GREENSPECTOR_CORE_SERVER_URL} by https://app.greenspector.com

  • ${PRIVATE_TOKEN} by your token. To find your token, go to the Greenspector interface, click on your name in the top right-hand corner, then click on the "Preferences" tab.

Modification of job.yml file

Edit the job.yml file you have just downloaded, replace :

  • ${APP_NAME} by the name of your application.

  • ${APP_VERSION} by the tested version (date, app version, other).

  • In the testFiles field, enter the path to your test scenario

  • ${MONITORED_PACKAGE} by the name of your application package. If you are measuring on a website, write "com.android.chrome".

  • ${PAUSEDURATION} by 1000 (1000 ms, i.e. 1 second)

  • ${PAUSEAFTERLOAD} by 1000 (1000 ms, i.e. 1 second)

Launch a functional journey analysis on a local android device

Launch of a functional journey on a local device needs :

  • GDSL script

  • job.yml & config.yml

  • Connected smartphone in adb

Reminders:

 Connect smartphone in adb USB

Enable USB debug

To launch measurements on tests in local mode, the Greenspector testrunner needs to establish a ADB (Android Debug Bridge) connection with the local device. An access to Android developer options is needed:

  • Go to the Android device settings

  • Go to About phone > Software information section

  • Tap 7 times on section Build Number. A pop-up confirms activation.

  • Go back to Settings / Developer options

  • Activate USB debugging option

The procedure can vary widely from a device to another. Please follow the official Android tutorial for more informations. Configure on-device developer options.

Connect device to computer

  • Plug the device to a computer via an USB cable

  • Run the following commands to verify USB connection:

adb kill-server
adb devices

adb kill-server is not mandatory, but restart adb helps to prevent connection problems.

  • The device should be detected. A pop-up Allow USB debugging? should appear on device. Click on Allow:

 Connect smartphone in adb WiFi

Activate ADB Wifi

  • Connect your device through USB

  • Verify ADB connection :

adb kill-server
adb devices

adb kill-server is not mandatory, but restart adb helps to prevent connection problems.

  • The device should be detected. If it’s the first connection, a pop-up Allow USB debugging? should appear on device. Click on Allow:

  • Run the following command to enable network connection:

adb tcpip 5555
  • Disconnect USB cable from your device

  • Run the following command to establish network connection:

adb connect [IP]:5555

Please replace [IP] with the device IP address which can be found in the phone connection settings.

  • Run the following command to verify network connection:

adb devices

You should see your device now identified with its IP.

Test launch

Testrunner is now ready to be launched. Simply launch it to start a test:

  • Go in the folder where job and config files are located

  • Launch the following command in the terminal

testrunner

Testrunner automatically recognizes config.yml and job.yml.

If different names or path are used, please specify them with: testrunner -c path/myconfig.yml -j path/myjob.yml

  • During the test execution and until test end:

    • Don’t close terminal

    • Don’t interact with device. Check device screen to see the test running.

Results

The Testrunner prompts the result at the end of the test. In case of failure, error’s line is given to help to adapt GDSL file. Results are available:

  • In your working directory with greenspector/dd-mm-yyyy XXhXXm/tests-results/results.txt

  • On app.greenspector.com if online is true in job.yml.

resultats_testrunner.png

For a better understanding, screenshots of steps are available at greenspector/dd-mm-yyyy XXhXXm/tests-results/MYAPP/parcours/iteration 1/screenshots. The final state is called success.png or failed.png regarding the result.

If the test succeeds, you can continue to write your script by following best practices (smile)

If your script is finished and ready to launch official measurements, follow:

If the test doesn’t succeed, you can consult the downloadable error report files :

  • A problematic line in the test file : This may indicate that the element you are trying to click on or waiting for is not accessible or present.

  • The failed.png image with a screenshot of the last screen before the error. This allows you to quickly identify the malfunction.

  • Screenshots of the steps that worked before the failed.

  • The dump.uix file, which contains an extraction of the screen composition. You can search this file for the text you want to automate, as well as the identifier of that element.

If the text is present in the failed screen and dump.uix but you get an error, it's possible that the element is not technically accessible. You can search for the element’s id in dump.uix and use an automation keyword such as clickById or waitById.

Refer to Methods details and appropriate troubleshooting according your displayed error.

Version change

It is possible to change version of results of measure as many times as needed. It can be a date, a new version of the application or website, a different journey, a functionality test, different test conditions, etc.

Change in job.yml :

  • ${APP_VERSION} by the tested version.

If you registered measures are stored online on https://app.greenspector.com/app/list by online=true in job.yml, versions, versions are visible in the Meter tab.

  • No labels