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 Next »

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

 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

  • Completed job.yml and config.yml files

 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 used for test, fill or replace :

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

  • ${PHONE_PORT} by 5555

  • ${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.

  • tcpdump:
    gatewayIP: IP of the gateway used to filter data
    networkInterface: Network interface used to detect data (wlp2s0...)
    keepPcap: true If true, it keeps the pcap file at the end of the measures
    ipFilters:
    apple: true

Go on Collect of data via network probe to have more details on tcpdump module and configure it.

Modification of job.yml file

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

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

  • ${APP_VERSION} by the name of your version.

  • 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 30000 (30000 milliseconds, i.e. 30 seconds)

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

  • online=true

  • skipsetupphone=false

  • tcpdump=true

  • iterations=3

To launch final measurements, take care about these parameters in job.yml :

  • iterations: 3

  • online: true

  • config-skipsetupphone: false

  • PAUSEDURATION: 30000

  • PAUSEAFTERLOAD: 1000

  • tcpdump:true

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 Wifi

Reminders:

 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.

Please disconnect the device from the USB cable to avoid altering the energy measurements by supplying power from the PC.

Test launch

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

  • 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 measurement execution and until measurement end:

    • Don’t close terminal

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

Results

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

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 doesn’t succeed, refer to Troubleshooting tool

If the test succeeds, congratulations! (smile)

Check the consistency of measures with Verification of measures consistency

  • No labels