Skip to main content

Integrate SmartUI with Appium Tests

Appium is an open-source tool for automating mobile application testing. It allows developers and testers to write tests for native, hybrid, and mobile web applications across multiple platforms, such as iOS and Android, using a single codebase.

LambdaTest SmartUI supports Appium automation tests for mobile applications through two integration methods:

  • SDK Integration: Available for Java
  • Hooks Integration: Available for JavaScript, Python, Ruby, and C#

Below is the list of supported languages and their integration methods:

Integration Methods

SDK Integration (Java)

The SmartUI App SDK provides a native Java library for integrating visual regression testing into your Appium Java test suite. This method offers:

  • Native Java API for screenshot capture
  • Type-safe integration with your existing test framework
  • Comprehensive error handling and logging

Documentation: Appium Java SDK - Complete guide with best practices and troubleshooting

Hooks Integration (JavaScript, Python, Ruby, C#)

For languages other than Java, SmartUI uses Hooks integration, which leverages Appium's execute command to capture screenshots. This method:

  • Works with any Appium-compatible language
  • Uses simple execute commands for screenshot capture
  • Supports both viewport and full-page screenshots

Documentation: Appium Hooks - Complete guide for JavaScript, Python, Ruby, and C# implementations

Quick Start with Hooks

Prerequisites:

  • Appium driver instance initialized
  • SmartUI project created with Project Token
  • LambdaTest credentials configured

Taking Viewport Screenshots:

Add the following code snippet in your test where you want to capture a screenshot:

driver.execute("smartui.takeScreenshot=<Name of your screenshot>");

Taking Full Page Screenshots (Native Apps):

For apps with scrolling functionality, you can capture full-page screenshots:

let config = {
screenshotName: '<Name of your screenshot>',
fullPage: true,
pageCount: 15 // Minimum 1, Maximum 20
};
await driver.execute("smartui.takeScreenshot", config);

Configuration:

Set your Project Token as an environment variable before running tests:

export PROJECT_TOKEN="your_project_token"

Next Steps

After selecting your preferred language, refer to the specific documentation for detailed integration steps:

  • Java SDK - Complete guide with best practices and troubleshooting
  • Appium Hooks - For JavaScript, Python, Ruby, and C# implementations

Additional Resources

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles