Skip to content

Commit

Permalink
Merge pull request #1096 from surishubham/main
Browse files Browse the repository at this point in the history
Aman's PR 1084, 85, 88,92,95
  • Loading branch information
surishubham authored Nov 21, 2024
2 parents 96a54c8 + 5b2636b commit f3bd9f0
Show file tree
Hide file tree
Showing 16 changed files with 548 additions and 163 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 3 additions & 17 deletions docs/app-auto-network-throttling.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: app-auto-network-throttling
title: Network Throttling
hide_title: true
hide_title: false
sidebar_label: Network Throttling
description: Now validate your mobile applications over low latency networks (2G/3G/LTE) or in offline mode with varying upload and download speeds. LambdaTest empowers you to simulate these mobile network conditions through its desired capabilities, ensuring comprehensive testing of your mobile applications.
keywords:
Expand Down Expand Up @@ -50,25 +50,11 @@ import TabItem from '@theme/TabItem';
})
}}
></script>

# Network Throttling

***
In Appium testing, assessing your app's performance under diverse network conditions (2G/3G/LTE) and offline scenarios, is crucial. Fluctuating upload and download speeds can significantly impact your app's behavior across different devices.

LambdaTest simplifies testing by enabling simulation of diverse network conditions. Whether starting with defaults or custom profiles, these features replicate real-world scenarios, proving invaluable for Appium tests. The device maintains uninterrupted internet connectivity throughout, ensuring a reliable testing experience for your mobile applications.

## Objectives
----

By the end of this guide, you will learn how to:
- Initialize a test session with predefined network profiles.
- Dynamically change network profiles during test execution using LambdaHooks.
- Define and implement custom network profiles.
- Reset the network profile to default settings.

## Workflow
----
### Initialization

- **Capability:** Initiate a test session with predefined network profiles using the `networkProfile` capability. Example:
Expand Down Expand Up @@ -137,12 +123,13 @@ To utilize the **networkProfile** capability, ensure that you include `network:

#### iOS


- **LambdaHook:** You can also switch to offline mode during the test execution with the following command:
```python
driver.execute_script("updateNetworkProfile=offline")
```

## Toggle Offline/Online Mode via API

- For both iOS and android devices you can use the offline/online mode API as well within the running test session:

```bash
Expand All @@ -152,7 +139,6 @@ To utilize the **networkProfile** capability, ensure that you include `network:
--data '{"mode": "offline"}'
```


:::note
- **Network throttling** results may vary sometimes based on multiple factors including network conditions and device performance.

Expand Down
185 changes: 185 additions & 0 deletions docs/application-setup-via-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
---
id: application-setup-via-api
title: Perform Operations on your Application via API
sidebar_label: via API
description: This guide will explain how to perform operations with your applications via api for real and virtual devices.
keywords:
- appium
- application operations
- lambdatest
- mobile testing
- apis
- setup application
url: https://www.lambdatest.com/support/docs/application-setup-via-api/
site_name: LambdaTest
slug: application-setup-via-api/
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys";
import CodeBlock from '@theme/CodeBlock';

<script type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify({
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://www.lambdatest.com"
},{
"@type": "ListItem",
"position": 2,
"name": "Support",
"item": "https://www.lambdatest.com/support/docs/"
},{
"@type": "ListItem",
"position": 3,
"name": "Applications",
"item": "https://www.lambdatest.com/support/docs/application-setup-via-api/"
}]
})
}}
></script>

To test your **iOS** (.ipa file) or **Android** (.apk or .aab file) application on LambdaTest, you can use our public REST APIs. In this documentation, we have listed all the operations you can perform with your application via APIs or cURL commands for both Virtual and Real Devices.

:::note
The maximum size for application should not exceed 1GB.
:::

:::tip
- If you do not have any **.apk** or **.ipa** file, you can run your sample tests on LambdaTest by using our sample :link: [Android app](https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk) or sample :link: [iOS app](https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_ios.ipa).
:::

## Upload your Application

| PARAMETER | EXAMPLE | DESCRIPTION |
|-----------------|-------------|------------|
| `custom_id` | `-F "custom_id="Proverbial_1.0"` | You do not have to remember the `app_URL` and only use the `custom_id` to run your automation on the same app. |
| `storage` | `-F "storage=file"` <br/> DEFAULT: `url` | Used to change the way LambdaTest stores the link. <br/> Used when we Upload using App URL |
| `visibility` | `-F "visibility=team"` <br/> DEFAULT: `individual` | Used to change the visibility of the application being uploaded. Once the app is uploaded using the `team`, everyone in the organisation can use the same URL to run the tests. |

### Using App File

<div className="lambdatest__codeblock">
<CodeBlock className="language-bash">
{`curl -u "${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -F "appFile=@"/Users/macuser/Downloads/Appname.apk"" -F "name="appname""
`}
</CodeBlock>
</div>

### Using App URL

<div className="lambdatest__codeblock">
<CodeBlock className="language-bash">
{`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" -F "custom_id=sampleName" -F "storage=url" -F "visibility=individual"`}
</CodeBlock>
</div>

- Response of above cURL will be a **JSON** object containing the `App URL` of the format - ``lt://APP123456789123456789``

:::warning note
The upload time of your application can range from a few seconds to a minute, depending on the size of your application. Therefore, do not interrupt the cURL command request until you receive the response.
:::

## Fetch your Applications

<Tabs className="docs__val">

<TabItem value="android" label="Android" default>
<div className="lambdatest__codeblock">
<CodeBlock className="language-bash">
{`curl --location --request GET "https://${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}@manual-api.lambdatest.com/app/data?type=android&level=user"`}
</CodeBlock>
</div>

</TabItem>

<TabItem value="ios" label="iOS" default>
<div className="lambdatest__codeblock">
<CodeBlock className="language-powershell">
{`curl --location --request GET "https://${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}@manual-api.lambdatest.com/app/data?type=ios&level=user"`}
</CodeBlock>
</div>

</TabItem>
</Tabs>

Shown below is the response to the above cURL request.

```javascript
{
"metaData": {
"type": "ios",
"total": 1
},
"data": [
{
"app_id": "APP100245789181570497850",
"name": "proverbial_ios.ipa",
"type": "ios",
"updated_at": "2022-05-10T11:19:30.000Z",
"shared": false,
"source": "web-client"
}
]
}
```

## Deleting your Application

To delete your uploaded apps, run the below cURL command.

<div className="lambdatest__codeblock">
<CodeBlock className="language-bash">
{`curl --location --request DELETE "https://${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}@manual-api.lambdatest.com/app/delete" \
--header 'Content-Type: application/json' \
--data-raw '{
"appIds" : "APPID1,APPID2"
}'
`}
</CodeBlock>
</div>

Shown below is the response to the above cURL request.

```javascript
{
"message": "Deleted successfully."
}
```

## Processing check for your Application

To unlock features such as network logs, image injection, and screenshotunblock feature for your application, app needs to undergo a processing phase. This processing takes a few minutes after the application is uploaded. You can verify if the processing is complete before running your automation script using the following API.

<div className="lambdatest__codeblock">
<CodeBlock className="language-bash">
{`curl --location --request POST 'https://mobile-api.lambdatest.com/mobile-automation/api/v1/fetchpatchedapkurl' \
--header 'Authorization: Basic c2hhbnRhbnV3OkFPOEh3NHJtV2hxUlJZSVl3OEk1elMzajhCS0c2ZHl3SVBZeXNNSDJPakdtbFVheXZC' \
--header 'Content-Type: application/json' \y
--data-raw '{
"appId": "APP10160161171698993659206876",
"networkLogsEnabled": true,
"imageInjectionEnabled": true,
"screenshotUnblockEnabled": true
}'`}
</CodeBlock>
</div>

The payload allows you to check the processing status for specific features. If the **patched_url** is empty, the processing is still in progress. To check if the processing for image injection or screenshot unblock is complete, pass either **imageInjectionEnabled** or **screenshotUnblockEnabled** as `true` based on the feature you are testing.

```javascript
{
"data": {
"imageinjection_ready": false, //current processing status
"patched_url": "",
"screenshotunblock_ready": false, //current processing status
"status": "success"
},
"status": "success"
}
```
69 changes: 69 additions & 0 deletions docs/application-setup-via-gui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
id: application-setup-via-gui
title: Perform Operations on your Application via GUI
sidebar_label: via GUI
description: Explore how to perform operations with your applications like uploading, deleting via gui for real and virtual devices.
keywords:
- appium
- application operations
- lambdatest
- mobile testing
- apis
- setup application
url: https://www.lambdatest.com/support/docs/application-setup-via-gui/
site_name: LambdaTest
slug: application-setup-via-gui/
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys";
import CodeBlock from '@theme/CodeBlock';
import NewTag from '../src/component/newTag';

<script type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify({
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://www.lambdatest.com"
},{
"@type": "ListItem",
"position": 2,
"name": "Support",
"item": "https://www.lambdatest.com/support/docs/"
},{
"@type": "ListItem",
"position": 3,
"name": "Applications",
"item": "https://www.lambdatest.com/support/docs/application-setup-via-gui/"
}]
})
}}
></script>
To test your iOS (.ipa file) or Android (.apk or .aab file) application on LambdaTest, you can upload them directly from the dashboard. In this documentation, we have listed the the ways via which you can upload your application for both Virtual and Real Devices.

## Real Device Dashboard
- **Access the Dashboard :** Log in to your LambdaTest account and navigate to the [Real Device dashboard](https://applive.lambdatest.com/app).
- **Initiate the Upload :** Click the Upload button in the dashboard and select your application file from your local system:
- **For Android :** Ensure the file is in `.apk` or `.aab` format.
- **For iOS :** Use `.ipa` format.
Wait for the file to upload and process. A success message will indicate when your application is ready.
- **Open App Settings :** Once uploaded, find your application in the list and click on the Settings button.
- **Copy the App ID :** In the settings, locate the App ID field. Copy this ID, as it will be required to reference your app in automated tests or other configurations.

<img loading="lazy" src={require('../assets/images/appium-app/application/real-device-upload.gif').default} alt="Image" className="doc_img"/>

> Learn how to [Upload Apps on LambdaTest’s Real Device Cloud](/support/docs/upload-apps-on-real-device-cloud/) in detail.
## Automation Dashboard
- **Access the App Automation Dashboard :** Log in to your LambdaTest account and navigate to the [App Automation Dashboard](https://appautomation.lambdatest.com/build).
- **Upload the Application :** Click the Browse File button in the App tab under the Real Device or Virtual Device section. Select your application file from your local system:
- **Android :** Upload a `.aab` or `.apk` file.
- **iOS :** Upload an `.ipa` file.
- **Copy the App URL :** After uploading, an `app_url` will be generated (format: `"lt://<app_url>"`). Copy this app_url and use it in your test scripts to identify your application.

<img loading="lazy" src={require('../assets/images/appium-app/application/automation-upload.gif').default} alt="Image" className="doc_img"/>
Loading

0 comments on commit f3bd9f0

Please sign in to comment.