Using the device interactively

In Suitest there are two primary modes of using a device: interactive and automated. Interactive mode is designed for operating a single device and to run test on that device. Automated mode is designed for unattended execution of many test automation scenarios on many devices.

Connecting to device interactively

To connect to the device interactively from Test Editor press Connect device in the top right corner of the screen. Then choose a device that you would like to connect to:

Choosing a device to interactively connect to
Choosing a device to interactively connect to

Once connected, Suitest will pop out device's virtual remote control and you can start operating the device. (On Android TV and Apple TV the remote is only open after Open app line)

To connect to the device via JavaScript API run:

await suitest.openSession({
    username: '',
    password: 'mypassword',
    orgId: 'xxxxxx-xxxxxxx-xxxxxx-xxxxx'

await suitest.pairDevice('device id');
await suitest.setAppConfig('app config id');

When you are connected to the device interactively you are spending the interactive minutes allocated in your subscription. Suitest will disconnect the device after 30 minutes of inactivity so that you don't draw out your account's entire allocation. To unpair from the device use releaseDevice.

Once connected to the device you can send navigational commands to it, like press button, open app etc. After the instrumentation library loads on the device you'll be able to run assertions.

Executing tests in interactive mode

When connected to a device in interactive mode you can execute tests (or parts of the test) on that device. Before executing the test you should select a configuration with which to run it. One test may be applicable to:

  • multiple platforms (Tizen, webOS, AppleTV, etc.)
  • different environments (live, staging, etc.)
  • multiple app instances (customerA, customerB)

An app configuration defines all of the above and lets you apply the test to the environment of your choice. To run the test with the selected configuration from the Test Editor press the Run test in the main toolbar.

Select configuration and run test
Select configuration and run test

To interactively run the test written with JavaScript API use:

suitest interactive \
    -u <your@e.mail> \
    -p <your password> \
    -o <organization id> \
    -d <device id> \
    -c <app config id> \
  node test.js

Running tests slower and with preview

You can also launch test in a Preview mode. In this mode the execution is slowed down and hints are shown in an onscreen overlay. This function is not available in Suitest API.

Running a test with preview artificially slows down the execution. This may cause the test to produce different results then when executed without preview. Before declaring your test scenario as complete always try running it without preview. You may see the same effect when running the test on a very slow device vs very fast device.

Running tests with preview
Running tests with preview

Running part of the test

Navigate with your mouse to the line at which you want the execution to start and in the line options menu select Set as start line. Then move mouse to the line where the execution should stop and press the Play icon in the right end of the line. There is no similar function in the JavaScript API, but you can easily accomplish the same with a couple of if statements.

The line options also contain Exclude line from execution option. A line marked like this will be temporarily excluded from the execution. Please note that the line remains excluded only during the current session and the exclusion is only visible to you.

Running only lines 4 - 6 and 9
Running only lines 4 - 6 and 9

Running tests step by step

In the Test Editor use the Play icon from the line options in the right end of the line. For JavaScript API based tests, to make the test stop at a particular point use the built-in debugging capabilities.

Running tests step by step can sometimes produce surprising results, since the application state will evolve differently then when running the entire test. For an example difference read about the Network request test subject.

Execute test to here
Execute test to here

Execute test to here and Mark as start line can be used to quickly run a part of your test.

Mark as start line
Mark as start line

Cleaning up execution results

The Test Editor will attribute the lines with the execution results including various status and error messages. To remove this attribution use More.. -> Clean test from the main toolbar.