Kobiton Tutorial: AI-Powered Mobile Testing on Real Devices

Kobiton Tutorial: AI-Powered Mobile Testing on Real Devices

Kobiton positions itself as an AI-powered alternative to traditional mobile device clouds. Beyond Appium support, it offers scriptless AI testing and AI-assisted test creation — useful for teams that want automation without deep programming expertise.

This tutorial covers both Kobiton's standard Appium integration and its AI-driven testing capabilities.

What Makes Kobiton Different

Most mobile device cloud providers are fundamentally device infrastructure businesses — they provide real devices and let your existing Appium code run on them. Kobiton adds:

AI Test Generation: Record a manual test session and Kobiton generates Appium test scripts automatically.

Scriptless Testing: Create tests by recording interactions without writing code. Tests are device-independent — Kobiton's AI adapts element locations across different devices.

Intelligent Test Re-execution: Run tests recorded on one device against multiple devices with AI-driven element detection that handles layout differences.

Failure Analysis: AI-generated analysis of test failures to identify root cause.

Account Setup and Credentials

After creating a Kobiton account:

  1. Navigate to SettingsProfile
  2. Copy your username (usually your email)
  3. Generate an API key from the API Keys section

You'll use these as:

  • Username: your Kobiton username (email)
  • Password: your API key (not your account password)

Appium Integration

Kobiton is Appium-compatible. Your existing Appium tests run on Kobiton with minimal configuration changes.

Capabilities Configuration

const capabilities = {
  sessionName: 'Login Flow',
  sessionDescription: 'Verify login with valid credentials',
  deviceOrientation: 'portrait',
  captureScreenshots: true,
  
  // Device selection
  deviceName: 'Galaxy S24',
  platformName: 'Android',
  platformVersion: '14.0',
  
  // App
  'appium:app': 'kobiton-store:123456',  // Upload ID from Kobiton
  'appium:automationName': 'UiAutomator2',
  
  // Kobiton-specific
  'appium:appWaitPackage': 'com.yourapp.package',
  'appium:appWaitActivity': '.MainActivity'
};

Kobiton server URL:

const driver = await remote({
  protocol: 'https',
  hostname: 'api.kobiton.com',
  path: '/wd/hub',
  port: 443,
  user: process.env.KOBITON_USERNAME,
  key: process.env.KOBITON_API_KEY,
  capabilities: capabilities
});

Uploading Your App

# Get upload URL
RESPONSE=$(curl -s -X POST <span class="hljs-string">"https://api.kobiton.com/v1/apps/uploadUrl" \
  -u <span class="hljs-string">"$KOBITON_USERNAME:<span class="hljs-variable">$KOBITON_API_KEY" \
  -H <span class="hljs-string">"Content-Type: application/json" \
  -d <span class="hljs-string">'{"filename": "app-debug.apk"}')

UPLOAD_URL=$(<span class="hljs-built_in">echo <span class="hljs-variable">$RESPONSE <span class="hljs-pipe">| jq -r <span class="hljs-string">'.url')
APP_ID=$(<span class="hljs-built_in">echo <span class="hljs-variable">$RESPONSE <span class="hljs-pipe">| jq -r <span class="hljs-string">'.appId')

<span class="hljs-comment"># Upload to S3
curl -T app-debug.apk <span class="hljs-string">"$UPLOAD_URL"

<span class="hljs-comment"># Use APP_ID in your capabilities: "kobiton-store:$APP_ID"
<span class="hljs-built_in">echo <span class="hljs-string">"App ID: $APP_ID"

Or use the Kobiton web dashboard to upload apps manually.

Running a Basic Appium Test

const { remote } = require('webdriverio');

async function runMobileTest() {
  const driver = await remote({
    protocol: 'https',
    hostname: 'api.kobiton.com',
    path: '/wd/hub',
    port: 443,
    logLevel: 'warn',
    capabilities: {
      sessionName: 'Checkout Flow Test',
      deviceOrientation: 'portrait',
      captureScreenshots: true,
      deviceName: 'iPhone 15',
      platformName: 'iOS',
      platformVersion: '17',
      'appium:app': 'kobiton-store:123456',
      'appium:automationName': 'XCUITest'
    }
  });

  try {
    // Navigate to product
    const searchBar = await driver.$('~search-bar');
    await searchBar.click();
    await searchBar.setValue('laptop');

    const firstResult = await driver.$('~product-item-0');
    await firstResult.click();

    const addToCart = await driver.$('~add-to-cart-button');
    await addToCart.click();

    const cartCount = await driver.$('~cart-badge');
    const count = await cartCount.getText();
    expect(count).toBe('1');

    await driver.executeScript('kobiton:sessionStatus=passed');
  } catch (error) {
    await driver.executeScript('kobiton:sessionStatus=failed');
    throw error;
  } finally {
    await driver.deleteSession();
  }
}

AI-Powered Scriptless Testing

Kobiton's scriptless testing lets you create device-independent tests by recording on one device and running on many.

Creating a Scriptless Test

  1. Start a manual session from the Kobiton dashboard
  2. Perform the actions you want to test (navigate, tap, type)
  3. Stop the session — Kobiton captures all interactions
  4. Name and save the test case

Configuring Scriptless Test Execution

From the Kobiton dashboard:

  1. Navigate to App Repository → select your app
  2. Go to Test Cases → select your recorded test
  3. Choose Run → select target devices
  4. Kobiton replays the test using AI element detection

The AI part: Kobiton doesn't use fixed selectors from your recording. It uses visual and contextual recognition to identify elements on different devices, even when layouts differ.

Scriptless Testing via API

# Trigger a scriptless test run
curl -X POST <span class="hljs-string">"https://api.kobiton.com/v1/revisitPlans" \
  -u <span class="hljs-string">"$KOBITON_USERNAME:<span class="hljs-variable">$KOBITON_API_KEY" \
  -H <span class="hljs-string">"Content-Type: application/json" \
  -d <span class="hljs-string">'{
    "deviceBundleId": 12345,
    "baselineSessionId": 67890,
    "appVersionId": 11111,
    "testCaseIds": [22222, 33333]
  }'

Viewing AI Test Results

After scriptless execution, Kobiton provides:

  • Side-by-side comparison: Recording vs. re-execution screenshots
  • Action-level pass/fail: Which specific interactions succeeded or failed
  • AI explanation: Why a step failed (element not found, unexpected state, etc.)
  • Suggested fixes: For common failure patterns

Device Discovery

Find available devices through the API:

# List online Android devices
curl -s <span class="hljs-string">"https://api.kobiton.com/v1/devices?isOnline=true&platformName=Android" \
  -u <span class="hljs-string">"$KOBITON_USERNAME:<span class="hljs-variable">$KOBITON_API_KEY" <span class="hljs-pipe">| \
  jq <span class="hljs-string">'.devices[] | {deviceName, platformVersion, udid}'

<span class="hljs-comment"># Filter by platform version
curl -s <span class="hljs-string">"https://api.kobiton.com/v1/devices?isOnline=true&platformName=iOS&platformVersion=17" \
  -u <span class="hljs-string">"$KOBITON_USERNAME:<span class="hljs-variable">$KOBITON_API_KEY" <span class="hljs-pipe">| \
  jq <span class="hljs-string">'.devices[].deviceName'

CI/CD Integration

GitHub Actions

# .github/workflows/kobiton.yml
name: Kobiton Mobile Tests

on:
  push:
    branches: [main, staging]

jobs:
  mobile-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Build Android APK
        run: ./gradlew assembleDebug
      
      - name: Upload app to Kobiton
        id: upload
        env:
          KOBITON_USERNAME: ${{ secrets.KOBITON_USERNAME }}
          KOBITON_API_KEY: ${{ secrets.KOBITON_API_KEY }}
        run: |
          # Get upload URL
          response=$(curl -s -X POST "https://api.kobiton.com/v1/apps/uploadUrl" \
            -u "$KOBITON_USERNAME:$KOBITON_API_KEY" \
            -H "Content-Type: application/json" \
            -d '{"filename": "app-debug.apk"}')
          
          upload_url=$(echo $response | jq -r '.url')
          app_id=$(echo $response | jq -r '.appId')
          
          # Upload file
          curl -T app/build/outputs/apk/debug/app-debug.apk "$upload_url"
          
          echo "app_id=$app_id" >> $GITHUB_OUTPUT
      
      - name: Run Appium tests on Kobiton
        env:
          KOBITON_USERNAME: ${{ secrets.KOBITON_USERNAME }}
          KOBITON_API_KEY: ${{ secrets.KOBITON_API_KEY }}
          KOBITON_APP_ID: ${{ steps.upload.outputs.app_id }}
          BUILD_NAME: "Build ${{ github.run_number }}"
        run: npm test

Jenkins Integration

pipeline {
  agent any
  
  environment {
    KOBITON_USERNAME = credentials('kobiton-username')
    KOBITON_API_KEY = credentials('kobiton-api-key')
  }
  
  stages {
    stage('Build') {
      steps {
        sh './gradlew assembleDebug'
      }
    }
    
    stage('Upload App') {
      steps {
        script {
          def response = sh(script: """
            curl -s -X POST "https://api.kobiton.com/v1/apps/uploadUrl" \
              -u "${KOBITON_USERNAME}:${KOBITON_API_KEY}" \
              -H "Content-Type: application/json" \
              -d '{"filename": "app-debug.apk"}'
          """, returnStdout: true)
          
          def json = readJSON text: response
          env.UPLOAD_URL = json.url
          env.APP_ID = json.appId
          
          sh "curl -T app/build/outputs/apk/debug/app-debug.apk '${env.UPLOAD_URL}'"
        }
      }
    }
    
    stage('Run Tests') {
      steps {
        sh 'npm test'
      }
    }
  }
}

Retrieving Test Results

# Get session details after completion
SESSION_ID=<span class="hljs-string">"your-session-id"

curl -s <span class="hljs-string">"https://api.kobiton.com/v1/sessions/$SESSION_ID" \
  -u <span class="hljs-string">"$KOBITON_USERNAME:<span class="hljs-variable">$KOBITON_API_KEY" <span class="hljs-pipe">| \
  jq <span class="hljs-string">'{status: .status, isFinished: .isFinished, log: .log}'

<span class="hljs-comment"># Download session video
VIDEO_URL=$(curl -s <span class="hljs-string">"https://api.kobiton.com/v1/sessions/$SESSION_ID/video" \
  -u <span class="hljs-string">"$KOBITON_USERNAME:<span class="hljs-variable">$KOBITON_API_KEY" <span class="hljs-pipe">| jq -r <span class="hljs-string">'.videoUrl')

curl -o <span class="hljs-string">"session-video.mp4" <span class="hljs-string">"$VIDEO_URL"

<span class="hljs-comment"># Get screenshots
curl -s <span class="hljs-string">"https://api.kobiton.com/v1/sessions/$SESSION_ID/screenshots" \
  -u <span class="hljs-string">"$KOBITON_USERNAME:<span class="hljs-variable">$KOBITON_API_KEY" <span class="hljs-pipe">| \
  jq <span class="hljs-string">'.[].downloadUrl'

Kobiton vs. Other Mobile Clouds

Feature Kobiton BrowserStack AWS Device Farm Sauce Labs
Real devices
AI scriptless testing Limited Limited
Appium support
Private devices
On-premise option
AWS integration Native
Pricing model Subscription Subscription Pay-per-minute Subscription

Kobiton's differentiation is AI-powered scriptless testing and cross-device AI element detection. If your team writes Appium fluently, the other providers offer similar device coverage at potentially lower cost. If you need scriptless testing for non-technical team members, Kobiton's AI capabilities are unique.

Best Practices

Use AI scriptless for stable core flows. The AI element detection works best on visually stable screens. Login, checkout, and settings screens are good candidates. Rapidly changing feature UIs are better served with coded tests.

Combine scriptless and coded tests. Use scriptless for user journey tests that product managers can understand and maintain. Use coded Appium for edge cases and complex scenarios.

Test on both phone and tablet. Kobiton's AI handles layout differences, but test the adaptation on your actual tablet/phone variants to confirm.

Use device bundles. Kobiton lets you define device groups ("top 5 Android phones") and run tests against the bundle. Easier to maintain than individual device specifications.

Enable visual comparison. Kobiton's visual regression feature compares screenshots between runs. Enable it for screenshot-sensitive UI tests.

Conclusion

Kobiton fills a specific niche: AI-powered scriptless testing for teams that need mobile test coverage without deep Appium expertise, or cross-device reliability testing where element detection needs to be intelligent rather than selector-based.

For teams already comfortable with Appium, Kobiton's standard mode works like any other cloud device provider. The value is in the AI features: record once, run everywhere, with AI handling device-specific layout differences.

For continuous monitoring that complements mobile test runs on Kobiton, HelpMeTest provides 24/7 automated testing and alerting for production environments.

Read more