diff --git a/docs/accessibility-android-test.md b/docs/accessibility-android-test.md new file mode 100644 index 000000000..4968a2d1f --- /dev/null +++ b/docs/accessibility-android-test.md @@ -0,0 +1,155 @@ +--- +id: accessibility-android-test +title: Automation Tests with Accessibility Tool using Android +sidebar_label: Android +description: Use LambdaTest Accessibility DevTools to detect and report accessibility issues with automation, following WCAG guidelines. +keywords: + - LambdaTest + - Accessibility + - Testing + - Automation + - Accessibility Testing Settings +url: https://www.lambdatest.com/support/docs/accessibility-android-test/ +site_name: LambdaTest +slug: accessibility-android-test/ +--- + +import CodeBlock from '@theme/CodeBlock'; +import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys"; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + +This guide walks you through automating accessibility testing of a native Android app using **LambdaTest's Accessibility Automation Tool (Beta) via Appium**. You'll run an automated accessibility scan on a real Android device hosted on LambdaTest’s real device cloud infrastructure. + +## Prerequisites + +- Your [LambdaTest Username and Access key](/support/docs/using-environment-variables-for-authentication-credentials/) +- Python 3.x or Java JDK 8+ installed +- Appium Python Client or Java Client Library + +## Step-by-Step Guide to Trigger Your Test + +### Step 1: Setup Your Test Suite + +You can use your own project to configure and test it. For demo purposes, we are using the sample repository. + +:::tip sample repo +Download or Clone the code sample from the LambdaTest GitHub repository to run your tests. + +Image View on GitHub +::: + +If you are using your own project, make sure you update the **Hub endpoint** in your tests file. By setting up the Hub endpoint, you establish the communication channel between your tests and the browser nodes, enabling effective test distribution and execution. + +Configure the desired capabilities based on your test requirements. For example: + + + + + +
+ + ```python + desired_cap = { + "platform": "android", + "isRealMobile": True, + "app": "lt://APP", # Replace with your LambdaTest App URL + "accessibility": True, + "buildName": "Accessibility-lambda", + "idleTimeout": 1800, + "build": "NewAppiumBuild", + "name": "MyTest", + "devicelog": True + } + ``` + +
+ +
+ + + +
+ ```java + DesiredCapabilities caps = new DesiredCapabilities(); + caps.setCapability("platform", "android"); + caps.setCapability("isRealMobile", true); + caps.setCapability("app", "lt://APPID"); // Replace with your App ID + caps.setCapability("accessibility", true); + caps.setCapability("idleTimeout", 1800); + caps.setCapability("build", "AccessibilityScanBuild"); + caps.setCapability("name", "MyTest"); + caps.setCapability("devicelog", true); + ``` +
+ +
+
+ + +> You can generate capabilities for your test requirements with the help of our inbuilt 🔗 [Capabilities Generator Tool](https://www.lambdatest.com/capabilities-generator/). + +### Step 2: Establish User Authentication + +Now, you need to export your environment variables *LT_USERNAME* and *LT_ACCESS_KEY* that are available in the [LambdaTest Profile page](https://accounts.lambdatest.com/detail/profile). + +Run the below mentioned commands in your terminal to setup the CLI and the environment variables. + + + + + +
+ + {`export LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}" +export LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`} + +
+ +
+ + + +
+ + {`set LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}" +set LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`} + +
+ +
+
+ +### Step 3: Execute and Monitor your Test + +Now execute your tests and visit the [Automation Dashboard](https://accounts.lambdatest.com/dashboard). Click on the Accessibility tab and check the report generated. + +```bash +mvn test +``` + +automation-dashboard diff --git a/sidebars.js b/sidebars.js index 024b8cae4..f5e4894f4 100644 --- a/sidebars.js +++ b/sidebars.js @@ -1692,6 +1692,11 @@ module.exports = { }, ] }, + { + type: 'doc', + label: 'Android', + id: 'accessibility-android-test', + }, { type: 'doc', label: 'Accessibility Automation Settings',