Write GDSL script

After defining a functional journey, it’s time to write!

  • Download template in Greenspector Studio/ Modules / GDSL Templates

  • Choose the appropriate file according to the project : Web, Android

  • Move them in a project folder

 

  • Modify {{.PackageName}} by the package name of your application, as the example below:

applicationKill,com.facebook.katana
applicationStart,com.facebook.katana

For a website, the package is the browser package: com.android.chrome

For applications, 3 possible methods:

  1. Connect by adb to the device

    1. Open a terminal anywhere and execute this command: adb shell pm list packages (list of packages on the device)

    2. Copy and paste into a text file and search by related keyword the package of your application

  2. Go on Playstore

    1. Find the application to measure

    2. The package name is visible in the url, here in the example: com.facebook.katana

  3. With UIAutomatorviewer

    1. Connect by adb

    2. Opent application to test

    3. Make a screenshot in UIAutomatorviewer with the button Device Screenshot

    4. The package name is written at bottom right

To learn about GDSL script structure, go on Introduction to GDSL

To launch the application

  • Measure reference inactivity on home screen

  • Launch the application

  • Wait for the last element to display (waitUntil)

measureStart,PAUSE_reference pause,${PAUSEDURATION} measureStop measureStart,CHRGT_homePage applicationStart,com.google.android.youtube waitUntilText,Home pause,${PAUSEAFTERLOAD} measureStop

To launch a website:

  • Launch the browser (setBrowser)

  • Prepare the browser by clearing cache and history (browserPrepareAndOpenForReference)

  • Measure the reference inactivity of an empty tab

  • Writing of URL (browserGoToUrl)

  • Measure the load of the website validating the URL (pressEnter)

  • Wait for the last element to display (waitUntil)

 

If, on installation, the application displays windows that do not appear in the follo

  • Solution 1 : It is mandatory to automate this process if you are going to use the testbench.

  • Solution 2 : switch to testrunner mode with local device to avoid reinstalling the application at each iteration

 

For each new view/page :

  • Do the action allowing to change view (clickBy)

  • Wait for the last element to display (waitUntil)

  • Verify the element waited doesn’t already exist before change view (assertNotExists)

  • Implement a pause step to measure inactive state

To get element characteristics in a view, go on Get elements of a view (Android)

For an action (click, write text, ..) or scroll :

  • Do 3 actions maximum in one measure

  • Separate them by appropriate pause (PAUSEAFTERACTION and PAUSEAFTERSCROLL)

Action :

Scroll :

For end technical steps (reliable for apps)

  • Come back on device home to measure app activity in background in a pause (pressHome)

  • Measure app activity after user close in a pause (applicationCloseAll)

  • Measure app activity after forced close (process close) in a pause (applicationKill)

 

Â