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
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
andPAUSEAFTERSCROLL
)
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
)
Â
Â