Skip to content

Commit

Permalink
Merge pull request #1084 from Aman1905/stage
Browse files Browse the repository at this point in the history
appium changes
  • Loading branch information
Ishavyas9 authored Nov 14, 2024
2 parents 2875530 + a27ece8 commit 49483be
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 30 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.
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.4

Expand Down
5 changes: 3 additions & 2 deletions docs/application-setup-via-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The maximum size for application should not exceed 1GB.
| `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:
### Using App File

<div className="lambdatest__codeblock">
<CodeBlock className="language-bash">
Expand All @@ -70,7 +70,7 @@ The maximum size for application should not exceed 1GB.
</CodeBlock>
</div>

### Using App URL:
### Using App URL

<div className="lambdatest__codeblock">
<CodeBlock className="language-bash">
Expand Down Expand Up @@ -162,6 +162,7 @@ To unlock features such as network logs, image injection, and screenshotunblock
--header 'Content-Type: application/json' \y
--data-raw '{
"appId": "APP10160161171698993659206876",
"networkLogsEnabled": true,
"imageInjectionEnabled": true,
"screenshotUnblockEnabled": true
}'`}
Expand Down
25 changes: 24 additions & 1 deletion docs/application-setup-via-gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,27 @@ import NewTag from '../src/component/newTag';
}]
})
}}
></script>
></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.

## via Real Device
- **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.
## via Automation
- **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"/>
11 changes: 1 addition & 10 deletions docs/desired-capabilities-in-appium.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ By setting these parameters, QAs can ensure that the Appium server accurately ta
| queueTimeout | TYPE: Integer <br/> DEFAULT: 600 <br/> `queueTimeout=300` | This capability can be used to modify the Queue timeout value within a range. queueTimeout Range : 300-900. |
| idleTimeout | TYPE: Integer <br/> DEFAULT: 120 <br/> `idleTimeout=120` | This capability can be used to modify the timeout value. |
| deviceOrientation | TYPE: STRING <br/> DEFAULT: PORTRAIT <br/> `deviceOrientation=portrait` <br/> OR <br/> `deviceOrientation=landscape` | Change the screen orientation of the device. |
| orientation | TYPE: STRING <br/> `orientation=auto` | Change the screen orientation of the device. |
| orientation | TYPE: STRING <br/> `orientation=auto` | This capability allows the app or browser to automatically adjust its display based on the physical orientation of the device. |
| newCommandTimeout | TYPE: STRING <br/> DEFAULT: 60 <br/> `newCommandTimeout=60` | | How long (in seconds) Appium will wait for a new command from the client before assuming the client quit and ending the session. |
| automationName | TYPE: STRING <br/> DEFAULT (Android): UiAutomator2 <br/> DEFAULT (iOS): XCUITest <br/> `automationName = UiAutomator2` | Choose which automation engine you'd like to use. <br/> Android - `UiAutomator2`, `Flutter`. <br/> iOS - `XCUITest`, `Flutter`. |
| eventTimings | TYPE: BOOLEAN <br/> DEFAULT: FALSE <br/> `true` | Enable or disable the reporting of the timings for various Appium-internal events (e.g., the start and end of each command, etc.). To enable, use true. The timings are then reported as events property on response to querying the current session. See the event timing docs for the the structure of this response. |
Expand Down Expand Up @@ -133,15 +133,6 @@ location | TYPE: HashMap <br/> <br/> Python example: <br/> `location: {"lat": "2
| dedicatedProxy | TYPE: BOOLEAN <br/> `dedicatedProxy=TRUE` <br/> OR <br/> `dedicatedProxy=FALSE` | Dedicated Proxy. |
| blockDomains | TYPE: Array of Strings <br/> `"blockDomains": ["www.facebook.com", "www.amazon.com"] ` | It is used to block the mentioned domains on the device.

### Network Throttling (Offline/Online)
To test your apps over an offline or online mode, pass the below cURL request within the running test session.

```bash
curl --location 'https://mobile-api.lambdatest.com/mobile-automation/api/v1/sessions/<session-id>/update_network' \
--header 'Authorization: Basic <username:access_key>' \
--header 'Content-Type: application/json' \
--data '{"mode": "offline/online"}'
```
</div>

> Got any questions?<br/>
Expand Down

0 comments on commit 49483be

Please sign in to comment.