You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -42,114 +42,165 @@ import TabItem from '@theme/TabItem';
42
42
})
43
43
}}
44
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.
45
46
46
-
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.
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).
47
48
48
49
## Prerequisites
50
+
Before getting started, ensure the following:
49
51
50
-
- Your [LambdaTest Username and Access key](/support/docs/using-environment-variables-for-authentication-credentials/)
51
-
- Python 3.x or Java JDK 8+ installed
52
-
- Appium Python Client or Java Client Library
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).
53
58
54
-
## Step-by-Step Guide to Trigger Your Test
59
+
> This will work for both Android and iOS applications.
55
60
56
-
###Step 1: Setup Your Test Suite
61
+
## Step 1: Setup the Environment Variables
57
62
58
-
You can use your own project to configure and test it. For demo purposes, we are using the sample repository.
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.
59
64
60
-
:::tip sample repo
61
-
Download or Clone the code sample from the LambdaTest GitHub repository to run your tests.
62
-
63
-
<ahref="https://github.com/LambdaTest/lambdatest-accessibility-selenium"className="github__anchor"><img loading="lazy" src={require('../assets/images/icons/github.png').default} alt="Image" className="doc_img"/> View on GitHub</a>
set LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`}
79
+
</CodeBlock>
80
+
</div>
81
+
</TabItem>
82
+
</Tabs>
65
83
66
-
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.
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.
67
86
68
-
Configure the desired capabilities based on your test requirements. For example:
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:
69
88
70
89
<TabsclassName="docs__val">
71
90
72
-
<TabItemvalue="python"label="Python"default>
73
-
91
+
<TabItemvalue="bash"label="App File"default>
74
92
<divclassName="lambdatest__codeblock">
75
-
76
-
```python
77
-
desired_cap = {
78
-
"platform": "android",
79
-
"isRealMobile": True,
80
-
"app": "lt://APP", # Replace with your LambdaTest App URL
> You can generate capabilities for your test requirements with the help of our inbuilt 🔗 [Capabilities Generator Tool](https://www.lambdatest.com/capabilities-generator/).
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).
115
112
116
-
### Step 2: Establish User Authentication
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
117
114
118
-
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).
115
+
:::
119
116
120
-
Run the below mentioned commands in your terminal to setup the CLI and the environment variables.
117
+
## Step 3: Configure required Capabilities
118
+
To enable accessibility testing, the following two configurations are mandatory:
set LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`}
141
-
</CodeBlock>
142
-
</div>
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/).
143
137
144
-
</TabItem>
145
-
</Tabs>
138
+
:::
146
139
147
-
### Step 3: Execute and Monitor your Test
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 asEC
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
Now execute your tests and visit the [Automation Dashboard](https://accounts.lambdatest.com/dashboard). Click on the Accessibility tab and check the report generated.
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.
0 commit comments