Skip to content

Commit 9596dd8

Browse files
authored
Merge pull request #1678 from Ishavyas9/main
accessibility app testing manual
2 parents 5140914 + 61774b3 commit 9596dd8

File tree

13 files changed

+594
-65
lines changed

13 files changed

+594
-65
lines changed
100 KB
Loading
101 KB
Loading
100 KB
Loading
98.7 KB
Loading
96.5 KB
Loading
97.9 KB
Loading
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
---
2+
id: accessibility-android-automation-test
3+
title: Automation Tests with Accessibility Tool using Android
4+
sidebar_label: Automation
5+
description: Use LambdaTest Accessibility DevTools to detect and report accessibility issues with automation, following WCAG guidelines.
6+
keywords:
7+
- LambdaTest
8+
- Accessibility
9+
- Testing
10+
- Automation
11+
- Accessibility Testing Settings
12+
url: https://www.lambdatest.com/support/docs/accessibility-android-automation-test/
13+
site_name: LambdaTest
14+
slug: accessibility-android-automation-test/
15+
---
16+
17+
import CodeBlock from '@theme/CodeBlock';
18+
import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys";
19+
import Tabs from '@theme/Tabs';
20+
import TabItem from '@theme/TabItem';
21+
22+
<script type="application/ld+json"
23+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
24+
"@context": "https://schema.org",
25+
"@type": "BreadcrumbList",
26+
"itemListElement": [{
27+
"@type": "ListItem",
28+
"position": 1,
29+
"name": "Home",
30+
"item": "https://www.lambdatest.com"
31+
},{
32+
"@type": "ListItem",
33+
"position": 2,
34+
"name": "Support",
35+
"item": "https://www.lambdatest.com/support/docs/"
36+
},{
37+
"@type": "ListItem",
38+
"position": 3,
39+
"name": "Accessibility Android Test",
40+
"item": "https://www.lambdatest.com/support/docs/accessibility-android-automation-test/"
41+
}]
42+
})
43+
}}
44+
></script>
45+
LambdaTest now enables native Accessibility Automation Testing for Android apps using HyperExecute and Appium. This feature helps developers and QA teams to validate the accessibility of their mobile apps programmatically by leveraging LambdaTest's device cloud.
46+
47+
With built-in support for `lambda-accessibility-scan`, this integration ensures that your apps are tested for compliance with accessibility standards and best practices like WCAG (Web Content Accessibility Guidelines).
48+
49+
## Prerequisites
50+
Before getting started, ensure the following:
51+
52+
- You have a LambdaTest account.
53+
- LambdaTest credentials (username & access key).
54+
- Android app uploaded to LambdaTest App Storage (lt://APP_ID).
55+
- Python 3 installed locally.
56+
- Appium-Python-Client installed
57+
- Access to a valid Android device on LambdaTest (real or virtual).
58+
59+
> This will work for both Android and iOS applications.
60+
61+
## Step 1: Setup the Environment Variables
62+
63+
You need to export your environment variables *LT_USERNAME* and *LT_ACCESS_KEY* that are available in your [LambdaTest Profile page](https://accounts.lambdatest.com/security). Run the below mentioned commands in your terminal to setup the environment variables.
64+
65+
<Tabs className="docs__val">
66+
<TabItem value="bash" label="Linux / MacOS" default>
67+
<div className="lambdatest__codeblock">
68+
<CodeBlock className="language-bash">
69+
{`export LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}"
70+
export LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`}
71+
</CodeBlock>
72+
</div>
73+
</TabItem>
74+
<TabItem value="powershell" label="Windows" default>
75+
<div className="lambdatest__codeblock">
76+
<CodeBlock className="language-powershell">
77+
{`set LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}"
78+
set LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`}
79+
</CodeBlock>
80+
</div>
81+
</TabItem>
82+
</Tabs>
83+
84+
## Step 2: Upload your Application
85+
Upload your **_iOS_** application (.ipa file) or **_android_** application (.apk or .aab file) to the LambdaTest servers using our **REST API**. You need to provide your **Username** and **AccessKey** in the format `Username:AccessKey` in the **cURL** command for authentication.
86+
87+
Make sure to add the path of the **appFile** in the cURL request. Below is an example cURL request to upload your app using our REST API:
88+
89+
<Tabs className="docs__val">
90+
91+
<TabItem value="bash" label="App File" default>
92+
<div className="lambdatest__codeblock">
93+
<CodeBlock className="language-bash">
94+
{`curl -u "${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -F "appFile=@"/Users/macuser/Downloads/proverbial_android.apk"" -F "name="proverbial_app""`}
95+
</CodeBlock>
96+
</div>
97+
</TabItem>
98+
99+
<TabItem value="powershell" label="App URL" default>
100+
<div className="lambdatest__codeblock">
101+
<CodeBlock className="language-bash">
102+
{`curl -u "${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -F "url=:https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk" -F "name=Proverbial_App"`}
103+
</CodeBlock>
104+
</div>
105+
</TabItem>
106+
107+
</Tabs>
108+
109+
:::tip
110+
111+
- If you do not have any **.apk** or **.ipa** file, you can run your sample tests on LambdaTest by using our sample apps, :link: [Android app](https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk) or :link: [iOS app](https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_ios.ipa).
112+
113+
- Response of above cURL will be a **JSON** object containing the `APP_URL` of the format - `lt://APP123456789123456789` and will be used in the next step
114+
115+
:::
116+
117+
## Step 3: Configure required Capabilities
118+
To enable accessibility testing, the following two configurations are mandatory:
119+
120+
- Enable accessibility in capabilities:
121+
```python
122+
"accessibility": True
123+
```
124+
125+
- Invoke scan via script:
126+
```python
127+
driver.execute_script("lambda-accessibility-scan")
128+
```
129+
130+
You may call `lambda-accessibility-scan` multiple times to scan different app screens or flows.
131+
132+
133+
:::info
134+
135+
- You must add the generated **APP_URL** to the `app` capability in the config file.
136+
- You can generate capabilities for your test requirements with the help of our inbuilt [**Capabilities Generator tool**](https://www.lambdatest.com/capabilities-generator/).For more details, please refer to our guide on [**Desired Capabilities in Appium**](https://www.lambdatest.com/support/docs/desired-capabilities-in-appium/).
137+
138+
:::
139+
140+
### Sample Script
141+
142+
```python
143+
from curses import flash
144+
import time
145+
# import requests
146+
from appium import webdriver
147+
from selenium.webdriver.support.ui import WebDriverWait
148+
from selenium.webdriver.support import expected_conditions as EC
149+
import unittest
150+
import os
151+
from appium import webdriver
152+
from appium.options.android import UiAutomator2Options
153+
import sys
154+
from selenium.webdriver.common.by import By
155+
from appium.webdriver.client_config import AppiumClientConfig
156+
157+
158+
options = UiAutomator2Options()
159+
options.load_capabilities({
160+
"platform": "android",
161+
"platformVersion": "14",
162+
"deviceName": "Galaxy S23 Ultra",
163+
"isRealMobile": True,
164+
"app" : "lt://YOUR_APP_ID",
165+
"accessibility": True,
166+
"buildName": "Accessibility-lambda",
167+
"idleTimeout": 1800,
168+
"build": "Accessibility Native App",
169+
"name": "Android App Accessibility",
170+
"devicelog": True,
171+
"visual": True,
172+
})
173+
url = "https://YOUR_LT_USERNAME:[email protected]/wd/hub"
174+
175+
client_config = AppiumClientConfig(
176+
remote_server_addr=url,
177+
ignore_certificates=True,
178+
direct_connection=True
179+
)
180+
181+
driver = webdriver.Remote(client_config.remote_server_addr, options = options, client_config=client_config)
182+
driver.implicitly_wait(2)
183+
184+
time.sleep(10)
185+
186+
time.sleep(10)
187+
driver.execute_script("lambda-accessibility-scan")
188+
time.sleep(10)
189+
driver.find_element(By.CSS_SELECTOR, '#username').send_keys("Pbtest1") # Example CSS selector
190+
driver.execute_script("lambda-accessibility-scan")
191+
192+
driver.quit()
193+
```
194+
195+
## Step 4: Execute and Monitor your Tests
196+
Run the following command in the directory where your project has been saved to execute your build.
197+
198+
```bash
199+
python3 test.py
200+
```
201+
202+
## Accessibility Dashboard and Reporting
203+
You can check the complete detailed report on the [Accessibility Dashboard](https://accessibility.lambdatest.com/automation)
204+
205+
<img loading="lazy" src={require('../assets/images/accessibility-testing/app-automation/6.png').default} alt="automation-dashboard" className="doc_img"/>
206+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
id: accessibility-android-rules
3+
title: Android Accessibility Rules - Quick Reference
4+
sidebar_label: Android
5+
description: Use LambdaTest Accessibility DevTools to detect and report accessibility issues with automation, following WCAG guidelines.
6+
keywords:
7+
- LambdaTest
8+
- Accessibility
9+
- Testing
10+
- Manual
11+
- Accessibility Testing Settings
12+
url: https://www.lambdatest.com/support/docs/accessibility-android-rules/
13+
site_name: LambdaTest
14+
slug: accessibility-android-rules/
15+
---
16+
17+
import CodeBlock from '@theme/CodeBlock';
18+
import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys";
19+
import Tabs from '@theme/Tabs';
20+
import TabItem from '@theme/TabItem';
21+
22+
<script type="application/ld+json"
23+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
24+
"@context": "https://schema.org",
25+
"@type": "BreadcrumbList",
26+
"itemListElement": [{
27+
"@type": "ListItem",
28+
"position": 1,
29+
"name": "Home",
30+
"item": "https://www.lambdatest.com"
31+
},{
32+
"@type": "ListItem",
33+
"position": 2,
34+
"name": "Support",
35+
"item": "https://www.lambdatest.com/support/docs/"
36+
},{
37+
"@type": "ListItem",
38+
"position": 3,
39+
"name": "Accessibility Android Rules",
40+
"item": "https://www.lambdatest.com/support/docs/accessibility-android-rules/"
41+
}]
42+
})
43+
}}
44+
></script>
45+
46+
| Rule Name | WCAG | Level | Impact | Description |
47+
|-----------|------|-------|--------|-------------|
48+
| Missing Image Alt | 1.1.1 | A | Critical | Images lack alternative text descriptions that screen readers can announce to users. Add `android:contentDescription` to meaningful images or set to empty string for decorative images to ensure proper accessibility support. |
49+
| Missing View Accessibility | 4.1.2 | A | Serious | Interactive elements like buttons, clickable views, or custom controls lack proper accessibility labels that describe their purpose. Ensure all interactive Views have clear `android:contentDescription` or associated labels for screen readers. |
50+
| Unlabeled Checkbox Element | 4.1.2 | A | Serious | Checkbox controls are missing accessible names that describe their purpose or current state. Provide descriptive labels using `android:text`, `android:contentDescription`, or associated TextView labels so users understand what they're selecting. |
51+
| Insufficient Color Ratio | 1.4.3 | AA | Serious | Text elements don't meet minimum contrast ratio requirements making them difficult to read for users with visual impairments. Maintain 4.5:1 ratio for normal text and 3:1 for large text by adjusting colors or background. |
52+
| Missing Field Label | 3.3.2 | A | Serious | Input fields like EditText lack descriptive labels that identify their purpose to users. Provide clear labels using `android:hint`, associated TextView with `android:labelFor`, or TextInputLayout to describe expected input. |
53+
| Non-accessible Interaction | 4.1.2 | A | Serious | Custom interactive elements, buttons, or gesture-based controls cannot be accessed or activated through assistive technology. Ensure all interactive elements have proper focus handling, role definition, and descriptive labels. |
54+
| Missing Screen Title | 2.4.2 | A | Serious | Activities or screens lack descriptive titles that help users understand their current location in the app. Set meaningful titles using `setTitle()` or `supportActionBar?.title` for proper navigation context. |
55+
| Unlabeled Toggle Control | 4.1.2 | A | Serious | Switch, toggle, or similar controls are missing accessible names that explain what they control and their current state. Provide descriptive labels that clearly indicate what the toggle affects (e.g., "Wi-Fi enabled"). |
56+
| Mismatched Label Text | 2.5.3 | A | Serious | The visible text label on a control differs from the programmatically accessible name, causing confusion for screen reader users. Ensure the accessible name includes or matches the visible text exactly. |
57+
| Missing Input Value | 4.1.2 | A | Moderate | Text fields are missing programmatic values that assistive technology can read, making it difficult for users to understand current input state. Ensure EditText values are properly exposed and announced by screen readers. |
58+
| Inaccessible Text Focus | 4.1.2 | A | Moderate | Text elements that receive focus lack proper accessibility properties, confusing screen reader users about their purpose. Either provide clear interactive roles and descriptions or remove focus capability for non-interactive text. |
59+
| Misplaced Field Label | 3.3.2 | A | Moderate | Form labels are not positioned correctly relative to their controls or lack proper programmatic association. Ensure labels appear visually before controls and use `android:labelFor` for proper screen reader announcement order. |
60+
| Nested Control Issues | 4.1.2 | A | Moderate | Interactive elements are incorrectly nested inside other interactive elements, creating focus traps and navigation confusion. Separate interactive elements into distinct, non-nested components to ensure proper accessibility navigation. |
61+
| Unnamed Nested Element | 4.1.2 | A | Moderate | Elements within containers lack their own accessible names when they should be independently accessible. Provide distinct labels for nested interactive elements or mark decorative elements as non-focusable. |
62+
| Fixed Orientation Lock | 1.3.4 | AA | Moderate | App restricts viewing to only portrait or landscape orientation without accessibility justification. Support both orientations or provide alternative access methods for users who cannot rotate their devices due to physical constraints. |
63+
| Undersized Touch Target | 2.5.5 | AAA | Moderate | Interactive elements are smaller than the recommended minimum touch target size, making them difficult to activate for users with motor impairments. Ensure all touch targets are at least 48dp x 48dp. |
64+
| Insufficient Target Spacing | 2.5.5 | AAA | Moderate | Interactive elements are placed too close together without adequate spacing, increasing risk of accidental activation. Provide sufficient spacing between adjacent touch targets to prevent targeting errors for users with limited dexterity. |

docs/accessibility-android-test.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
id: accessibility-android-test
3+
title: Accessibility Testing Using App Manual Testing
4+
sidebar_label: Manual
5+
description: Use LambdaTest Accessibility DevTools to detect and report accessibility issues with automation, following WCAG guidelines.
6+
keywords:
7+
- LambdaTest
8+
- Accessibility
9+
- Testing
10+
- Manual
11+
- Accessibility Testing Settings
12+
url: https://www.lambdatest.com/support/docs/accessibility-android-test/
13+
site_name: LambdaTest
14+
slug: accessibility-android-test/
15+
---
16+
17+
import CodeBlock from '@theme/CodeBlock';
18+
import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys";
19+
import Tabs from '@theme/Tabs';
20+
import TabItem from '@theme/TabItem';
21+
22+
<script type="application/ld+json"
23+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
24+
"@context": "https://schema.org",
25+
"@type": "BreadcrumbList",
26+
"itemListElement": [{
27+
"@type": "ListItem",
28+
"position": 1,
29+
"name": "Home",
30+
"item": "https://www.lambdatest.com"
31+
},{
32+
"@type": "ListItem",
33+
"position": 2,
34+
"name": "Support",
35+
"item": "https://www.lambdatest.com/support/docs/"
36+
},{
37+
"@type": "ListItem",
38+
"position": 3,
39+
"name": "Accessibility Android Test",
40+
"item": "https://www.lambdatest.com/support/docs/accessibility-android-test/"
41+
}]
42+
})
43+
}}
44+
></script>
45+
LambdaTest offers a powerful Accessibility Scanner for native Android apps, integrated seamlessly with our manual app testing environment. This helps QA teams and developers identify accessibility issues directly during real-time testing sessions. Follow this guide to understand how to perform accessibility scans manually.
46+
47+
## Prerequisites
48+
- You must have access to the LambdaTest Real Device Cloud.
49+
- Your Android app (.apk or .aab) should be uploaded to the platform.
50+
- Ensure you have enabled the Accessibility feature from your account or project settings, if applicable.
51+
52+
## Steps to perform Accessibility Testing using the App Scanner
53+
### Step 1: Navigate to the Accessibility Section
54+
- Log in to your LambdaTest dashboard.
55+
- From the left-hand menu, click on Accessibility.
56+
- Select the **App Scanner** tab under the Accessibility tab.
57+
58+
### Step 2: Upload your Application
59+
- To start accessibility testing, you need to upload your application first.
60+
- Click on the **Upload** button to upload it from your local system.
61+
- You can also install via Playstore or Firebase or upload via URL.
62+
63+
<img loading="lazy" src={require('../assets/images/accessibility-testing/app-automation/app-upload.png').default} alt="Image" className="doc_img img_center"/>
64+
65+
### Step 3: Launch Manual App Testing
66+
- Choose the target Android device and select your application.
67+
- Click on the **Start** button to launch the manual testing session on the selected device.
68+
69+
### Step 4: Scan the App Screens
70+
- Once the session is started and your app is launched on the device, click on the **Start Scanning** button to start the scanning of current page.
71+
<img loading="lazy" src={require('../assets/images/accessibility-testing/app-automation/1.png').default} alt="Image" className="doc_img img_center"/>
72+
<br />
73+
- Interact with your app just like a real user — navigate through different screens, buttons, and views.
74+
- The scanner will analyze the current screen and return a list of detected accessibility issues.
75+
76+
<img loading="lazy" src={require('../assets/images/accessibility-testing/app-automation/2.png').default} alt="Image" className="doc_img img_center"/>
77+
78+
### Step 5: Review Accessibility Issues
79+
After scanning, you’ll see a categorized list of issues based on severity (Critical, Serious, Moderate, Minor). Each issue includes:
80+
- Description of the accessibility problem.
81+
- List of affected element.
82+
- Suggested fix or recommendation.
83+
84+
Continue testing by navigating to additional screens in the app and scanning them one-by-one. This helps ensure that your entire app meets accessibility standards across all flows and use cases.
85+
86+
<img loading="lazy" src={require('../assets/images/accessibility-testing/app-automation/3.png').default} alt="Image" className="doc_img img_center"/>
87+
88+
### Step 6: Accessibility Report
89+
After completion of your scanning, click on the **Save Test** button.
90+
- Go to the **Manual Reports** tab under the Accessibility tab.
91+
- Select your desired report
92+
- You can also share the report over email, export it in JSON, CSV and PDF format, and also you create an issue as well for that report.
93+
94+
<img loading="lazy" src={require('../assets/images/accessibility-testing/app-automation/4.png').default} alt="Image" className="doc_img img_center"/>

0 commit comments

Comments
 (0)