Auto-generate capabilities

Learn how to auto-generate capabilities and add them to your test script so you can interact with the Kobiton API during an automation session.

Open automation settings

After you find a device, select the vertical ellipses to open the device information.

Next, select Automation Settings.

Choose capabilities

First, choose a language and a framework for your auto-generated capabilities.

Choose the capabilities you want to add. When you do, your DesiredCapabilities object will update automatically.

Example
String kobitonServerUrl = "https://<user-name>:<api-key>@api.kobiton.com/wd/hub"; // <user-name> and <api-key> will be automatically replaced with your credentials.

desiredCapabilities.put("sessionName", "Biometric authentication");
desiredCapabilities.put("sessionDescription", "Testing biometric authentication for the login screen.");
desiredCapabilities.put("deviceOrientation", "portrait");
desiredCapabilities.put("noReset", true);
desiredCapabilities.put("fullReset", false);
desiredCapabilities.put("captureScreenshots", true);
desiredCapabilities.put("useConfiguration", "");
desiredCapabilities.put("autoWebview", true);
desiredCapabilities.put("browserName", "safari");
desiredCapabilities.put("groupId", 0011);
desiredCapabilities.put("deviceGroup", "ORGANIZATION");
desiredCapabilities.put("deviceName", "iPhone XS");
desiredCapabilities.put("tagName", "");
desiredCapabilities.put("platformName", "iOS");
desiredCapabilities.put("platformVersion", "15.5");

When you’re finished, select the Copy to clipboard icon so you can update your test script.

Add capabilities

First, open your test suite and locate your config file. The exact name and location may vary, but you’ll find it in a similar location:

Example
root
└── src
    └── test
        └── Config # Java TestNG
        └── Config.java # Java JUnit
        └── config.js # NodeJS Mocha

Next, open the config file, locate your existing DesiredCapabilities object, and add your new capabilities. When you’re finished, save your changes.

Example
// Located in ~/test/scriptlessautomation/Config in the Java's TestNG framework.

public static DesiredCapabilities getIPhone11ProIOS146DesiredCapabilities() {

    String kobitonServerUrl = "https://<user-name>:<api-key>@api.kobiton.com/wd/hub";

    desiredCapabilities.put("sessionName", "Biometric authentication");
    desiredCapabilities.put("sessionDescription", "Testing biometric authentication for the login screen.");
    desiredCapabilities.put("deviceOrientation", "portrait");
    desiredCapabilities.put("noReset", true);
    desiredCapabilities.put("fullReset", false);
    desiredCapabilities.put("captureScreenshots", true);
    desiredCapabilities.put("useConfiguration", "");
    desiredCapabilities.put("autoWebview", true);
    desiredCapabilities.put("browserName", "safari");
    desiredCapabilities.put("groupId", 0011);
    desiredCapabilities.put("deviceGroup", "ORGANIZATION");
    desiredCapabilities.put("deviceName", "iPhone XS");
    desiredCapabilities.put("tagName", "");
    desiredCapabilities.put("platformName", "iOS");
    desiredCapabilities.put("platformVersion", "15.5");

    return capabilities;
}