Open app - operation¶
- Android TV
- Apple TV
- Apple TV Simulator
- HbbTV / Freeview Play
- LG webOS / Netcast
- Philips NetTV
- Playstation 4
- Samsung Tizen / Orsay
- Xbox One
This operation installs and opens the application on the device.
To perform this operation in the Suitest Test editor use the Open App line:
The behavior of Open app varies across platforms:
On Android TV, Apple TV (tvOS), HbbTV / Freeview Play, LG webOS, PlayStation 4, Roku, Samsung Tizen, Websites and Xbox One the application is opened automatically. Additionally for Android TV, LG webOS, PlayStation 4, Roku, Samsung Tizen and Xbox One Suitest checks the version of the app currently installed on device and installs correct version as necessary.
Sometimes installing an app may take longer time, especially if the package size is bigger. So just be patient ...
On generic HTML-based platforms Suitest cannot install nor open the app automatically. You will need to either override the Open App command or open the application manually every time you start the test.
Overriding Open App operation¶
Suitest allows to override the Open App operation by specifying a test to be executed instead. You can define the Open App override on the configuration level.
The override test should contain steps that would eventually lead to opening the application on the target device. In the override test you are limited to Press button (except the conditional modifiers), Sleep and Poll URL operations.
Manual Open app¶
On platforms where automated app opening is not supported, Suitest will by default pause the execution and notify the test operator to install and open the application manually. The rest of the test will complete automatically.
On platforms that do not support automatic app opening:
Open App line in the Test Editor will only work if it is the first line in the test.
openApp()API method will throw an exception.
Automating Open App¶
There are several ways how to automate your Open App operation:
Open app override should not include Open app line
You should not include the Open app line inside of the Open app override otherwise manual action will be required on platforms which do not feature the automatic Open app.
Doing it with "Press button"¶
In many situations, you will be able to perform a stable sequence of key
presses that will eventually open the application. For example, on the Samsung
Orsay, applications are arranged in a grid. To get to the grid, you need to
Smart button (a special Samsung button on the remote), so the
sequence of steps of opening an app that is listed in the top left corner of
the grid would look like this:
You may need to make this sequence more robust so that it does not break, for example, when the device already has the Smart Hub open, to fix that add an exit to the beginning:
The first two lines make sure that if the Smart Hub ran, it would be closed before attempting to open our app again.
You may be required to cover several edge-cases. Be sure to add quality comments to every step of your sequence so that later on you will be able to understand what the purpose of every step was.
Doing it with Poll URL¶
Many device manufacturers have some sort of a Software Development Kit (SDK) for building apps for their platform. The SDK is usually able to install and open apps on the TV.
If you are familiar with such an SDK it is easy to create a web service that would trigger the SDK command for app installation.
Then, in your app override test use Poll URL operation to call the web service URL from the test and have the application open.
Not automating Open App¶
Depending on your use case, it may not be necessary to automate this line at all. Consider that you can still run your entire test suite automatically but you do need to trigger the execution manually.
You should create your test scenarios as you would under any other circumstances. Make them small and independent from one another, organize them neatly in folders and tag them with meaningful tags so that you have little maintenance work in the future.
When it comes to the scheduled test execution, concentrate on reducing the amount of times you are required to open an application on devices. To achieve this, create a master test and use Run test operation to run several tests sequentially.