diff --git a/docs/smartui-appium-sdk.md b/docs/smartui-appium-sdk.md index 8e692adb..d8b923df 100644 --- a/docs/smartui-appium-sdk.md +++ b/docs/smartui-appium-sdk.md @@ -1,8 +1,8 @@ --- id: smartui-appium-sdk -title: Integrate SmartUI SDK with Appium Tests +title: Integrate SmartUI with Appium Tests sidebar_label: Appium -description: In this documentation, learn how integrate your Appium automated tests with LambdaTest's SmartUI. +description: Learn how to integrate your Appium automated tests with LambdaTest's SmartUI. Java uses both SDK and hooks integration, while JavaScript, Python, Ruby, and C# use Hooks integration. keywords: - Visual Regression - Visual Regression Testing Guide @@ -48,41 +48,46 @@ import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/co > 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. -The LambdaTest SmartUI SDK supports multiple programming languages for running Appium automation tests on mobile browsers.
Below is the list of supported languages: +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:
Java
Javascript
Python
Ruby
C#
@@ -91,6 +96,153 @@ The LambdaTest SmartUI SDK supports multiple programming languages for running A

We support all languages and frameworks that are compatible with Appium, so in case your favorite isn't in the table.
Don't worry, you can still run the test. window.openLTChatWidget()}>Contact Us for any help.

+## 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](/support/docs/smartui-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](/support/docs/smartui-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: + + + + +```javascript +driver.execute("smartui.takeScreenshot="); +``` + + + + +```python +driver.execute("smartui.takeScreenshot=") +``` + + + + +```ruby +driver.execute("smartui.takeScreenshot=") +``` + + + + +```csharp +driver.Execute("smartui.takeScreenshot="); +``` + + + + +**Taking Full Page Screenshots (Native Apps):** + +For apps with scrolling functionality, you can capture full-page screenshots: + + + + +```javascript +let config = { + screenshotName: '', + fullPage: true, + pageCount: 15 // Minimum 1, Maximum 20 +}; +await driver.execute("smartui.takeScreenshot", config); +``` + + + + +```python +config = { + 'screenshotName': '', + 'fullPage': True, + 'pageCount': 15 # Minimum 1, Maximum 20 +} +driver.execute("smartui.takeScreenshot", config) +``` + + + + +```ruby +config = { + 'screenshotName' => '', + 'fullPage' => true, + 'pageCount' => 15 # Minimum 1, Maximum 20 +} +driver.execute("smartui.takeScreenshot", config) +``` + + + + +```csharp +var config = new Dictionary { + {"screenshotName", ""}, + {"fullPage", true}, + {"pageCount", 15} // Minimum 1, Maximum 20 +}; +driver.Execute("smartui.takeScreenshot", config); +``` + + + + +**Configuration:** + +Set your Project Token as an environment variable before running tests: + + + + +```bash +export PROJECT_TOKEN="your_project_token" +``` + + + + +```bash +set PROJECT_TOKEN=your_project_token +``` + + + + +```powershell +$env:PROJECT_TOKEN="your_project_token" +``` + + + + ## Next Steps After selecting your preferred language, refer to the specific documentation for detailed integration steps: