From 8cd4e2be230335f63aef52decb2cce591eaf262a Mon Sep 17 00:00:00 2001 From: Aman Chopra Date: Mon, 11 Nov 2024 14:56:57 +0530 Subject: [PATCH] orientation desired capability --- docs/desired-capabilities-in-appium.md | 159 ++++++++++--------------- 1 file changed, 61 insertions(+), 98 deletions(-) diff --git a/docs/desired-capabilities-in-appium.md b/docs/desired-capabilities-in-appium.md index 8c97decd1..891589d44 100644 --- a/docs/desired-capabilities-in-appium.md +++ b/docs/desired-capabilities-in-appium.md @@ -43,128 +43,97 @@ slug: desired-capabilities-in-appium/ }) }} > - ---- - Desired capabilities in [Appium](https://www.lambdatest.com/appium) are essential for guiding the Appium server to create the correct test automation environment. Represented as a set of key-value pairs within a JSON object, these capabilities allow [QA automation](https://www.lambdatest.com/blog/qa-automation/) engineers to specify the desired mobile platform and configuration for their test sessions. By setting these parameters, QAs can ensure that the Appium server accurately targets the intended test environment, facilitating effective and efficient [mobile app testing](https://www.lambdatest.com/mobile-app-testing). > **Note:** With LambdaTest [capabilities generator](https://www.lambdatest.com/capabilities-generator/) run your App Automation leveraging Appium Desktop. -
- ## Mandatory capabilities - - -| KEY | VALUES | CAPABILITY DESCRIPTION | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| user | TYPE: STRING | Your LT username. | -| accessKey | TYPE: STRING | Your LT Access Key. | -| isRealMobile | TYPE: BOOLEAN
DEFAULT: FALSE
`isRealMobile=TRUE`
OR
`isRealMobile=FALSE` | This capability is used to run the test on Real Device. | -| deviceName | TYPE: STRING
`iPhone 13` | Name of the device. -| platformName | TYPE: STRING
`ios` | Name of the OS. | -| platformVersion | TYPE: STRING
`14` | OS version. | - - +| KEY | VALUES | CAPABILITY DESCRIPTION | +|-----|------- | ---------------------- | +| user | TYPE: STRING | Your `LT_USERNAME` | +| accessKey | TYPE: STRING | Your `LT_Access_Key`| +| isRealMobile | TYPE: BOOLEAN
DEFAULT: FALSE
`isRealMobile=TRUE`
OR
`isRealMobile=FALSE` | This capability is used to run the test on Real Device. | +| deviceName | TYPE: STRING
`iPhone 13` | Name of the device. +| platformName | TYPE: STRING
`ios` | Name of the OS. | +| platformVersion | TYPE: STRING
`14` | OS version. | ## Debugging Options - - -| KEY | VALUES | CAPABILITY DESCRIPTION | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| video | TYPE: BOOLEAN
DEFAULT: TRUE
`video=TRUE`
OR
`video=FALSE` | Video recording of the complete screen. | -| devicelog | TYPE: BOOLEAN
DEFAULT: FALSE
`devicelog=TRUE`
OR
`devicelog=FALSE` | Enable Device logs. | -| network | TYPE: BOOLEAN
DEFAULT: FALSE
`network=TRUE`
OR
`network=FALSE` | Enable Network logs. | -| console | TYPE: Boolean
DEFAULT: FALSE
`console: true` | Used to fetch the console logs.| - - - +| KEY | VALUES | CAPABILITY DESCRIPTION | +|-----|--------| -----------------------| +| video | TYPE: BOOLEAN
DEFAULT: TRUE
`video=TRUE`
OR
`video=FALSE` | Video recording of the complete screen. | +| devicelog | TYPE: BOOLEAN
DEFAULT: FALSE
`devicelog=TRUE`
OR
`devicelog=FALSE` | Enable Device logs. | +| network | TYPE: BOOLEAN
DEFAULT: FALSE
`network=TRUE`
OR
`network=FALSE` | Enable Network logs. | +| console | TYPE: Boolean
DEFAULT: FALSE
`console: true` | Used to fetch the console logs.| ## Test configuration - - -| KEY | VALUES | CAPABILITY DESCRIPTION | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| build | TYPE: STRING
DEFAULT: Untitled
`build=iOS Small Run` | You can group your tests like a job containing multiple tests. | -| name | TYPE: STRING
DEFAULT: TestID of the Test. In case the Name is not passed.
`name=iphone 6 Small Run` | Name of your test. | -| project | Will remain blank in case 'project' is not passed in capability.
`project=Small Run` | You can group your builds like a project containing multiple jobs. | -| queueTimeout | TYPE: Integer
DEFAULT: 600
`queueTimeout=300` | This capability can be used to modify the Queue timeout value within a range. queueTimeout Range : 300-900. | -| idleTimeout | TYPE: Integer
DEFAULT: 120
`idleTimeout=120` | This capability can be used to modify the timeout value. | -| deviceOrientation | TYPE: STRING
DEFAULT: PORTRAIT
`deviceOrientation=portrait`
OR
`deviceOrientation=landscape` | Change the screen orientation of the device. | -| newCommandTimeout | TYPE: STRING
DEFAULT: 60
`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
DEFAULT (Android): UiAutomator2
DEFAULT (iOS): XCUITest
`automationName = UiAutomator2` | Choose which automation engine you'd like to use.
Android - `UiAutomator2`, `Flutter`.
iOS - `XCUITest`, `Flutter`. | -| eventTimings | TYPE: BOOLEAN
DEFAULT: FALSE
`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. | -| otherApps | TYPE: ARRAY OF STRINGS
DEFAULT: [ ] or Empty Array
`"otherApps":`
`["lt://APP1002211081648217405891389",`
`"lt://APP1002211081648217429465823"]` | Accepts a list of App URLs returned after uploading an app on the LambdaTest servers.
Conditions to be satisfied:
1. App should also be passed if "otherApps" is passed.
2. Length of app URL
array ≤ 3.
3. At max 3 other apps can be installed.
4. App should not be present inside 'otherApp' array.
5. No duplicates in ‘otherApp’ array. | -| globalHttpProxy | TYPE: BOOLEAN
DEFAULT: FALSE
globalHttpProxy = true | This is only for Android specific applications and devices.
If the customer’s app requires Proxy to enable Data Transfer that is not possible otherwise, they can reach out to the CS & LT will enable it for them from BE.This is not available for customers directly unless set from BE by LT. | -| region | TYPE: STRING
DEFAULT: Location of the nearest data center
`region = US` | 1. By default, it picks the location of the nearest data center.
2. If you would like to change the region of the Data Center manually, you can pass this capability.
3. Currently, only three regions are supported: Europe - "EU", USA - "US" and Asia-Pacific - "AP" | -| waitForIdleTimeout | TYPE: BOOLEAN
`waitForIdleTimeout = 0` | 1. Sets the timeout for waiting for the user interface to go into an idle state before starting a UI Automator action.
2. It changes the timeout of the configuration in UIAutomator and could help to make interaction speed faster.| +| KEY | VALUES | CAPABILITY DESCRIPTION | +|-----|--------| -----------------------| +| build | TYPE: STRING
DEFAULT: Untitled
`build=iOS Small Run` | You can group your tests like a job containing multiple tests. | +| name | TYPE: STRING
DEFAULT: TestID of the Test. In case the Name is not passed.
`name=iphone 6 Small Run` | Name of your test. | +| project | Will remain blank in case 'project' is not passed in capability.
`project=Small Run` | You can group your builds like a project containing multiple jobs. | +| queueTimeout | TYPE: Integer
DEFAULT: 600
`queueTimeout=300` | This capability can be used to modify the Queue timeout value within a range. queueTimeout Range : 300-900. | +| idleTimeout | TYPE: Integer
DEFAULT: 120
`idleTimeout=120` | This capability can be used to modify the timeout value. | +| deviceOrientation | TYPE: STRING
DEFAULT: PORTRAIT
`deviceOrientation=portrait`
OR
`deviceOrientation=landscape` | Change the screen orientation of the device. | +| orientation | TYPE: STRING
`orientation=auto` | Change the screen orientation of the device. | +| newCommandTimeout | TYPE: STRING
DEFAULT: 60
`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
DEFAULT (Android): UiAutomator2
DEFAULT (iOS): XCUITest
`automationName = UiAutomator2` | Choose which automation engine you'd like to use.
Android - `UiAutomator2`, `Flutter`.
iOS - `XCUITest`, `Flutter`. | +| eventTimings | TYPE: BOOLEAN
DEFAULT: FALSE
`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. | +| otherApps | TYPE: ARRAY OF STRINGS
DEFAULT: [ ] or Empty Array
`"otherApps":`
`["lt://APP1002211081648217405891389",`
`"lt://APP1002211081648217429465823"]` | Accepts a list of App URLs returned after uploading an app on the LambdaTest servers.
Conditions to be satisfied:
1. App should also be passed if "otherApps" is passed.
2. Length of app URL
array ≤ 3.
3. At max 3 other apps can be installed.
4. App should not be present inside 'otherApp' array.
5. No duplicates in ‘otherApp’ array. | +| globalHttpProxy | TYPE: BOOLEAN
DEFAULT: FALSE
globalHttpProxy = true | This is only for Android specific applications and devices.
If the customer’s app requires Proxy to enable Data Transfer that is not possible otherwise, they can reach out to the CS & LT will enable it for them from BE.This is not available for customers directly unless set from BE by LT. | +| region | TYPE: STRING
DEFAULT: Location of the nearest data center
`region = US` | 1. By default, it picks the location of the nearest data center.
2. If you would like to change the region of the Data Center manually, you can pass this capability.
3. Currently, only three regions are supported: Europe - "EU", USA - "US" and Asia-Pacific - "AP" | +| waitForIdleTimeout | TYPE: BOOLEAN
`waitForIdleTimeout = 0` | 1. Sets the timeout for waiting for the user interface to go into an idle state before starting a UI Automator action.
2. It changes the timeout of the configuration in UIAutomator and could help to make interaction speed faster.| | privateCloud | TYPE: BOOLEAN
DEFAULT: FALSE
`privateCloud: True`| If your organization has opted for Private Cloud, then using this flag will fetch the devices from your Private Cloud.
If your organization has not opted for Private Cloud, your test can fail if this capability is passed.| -| w3c | TYPE: Boolean
DEFAULT: FALSE
`w3c: true` | Appium will use the W3C webdriver protocol when it's set to true.| -| autoLaunch | TYPE: Boolean
DEFAULT: TRUE
`autoLaunch: false`| If the user doesn't pass this, the app will start on boot. Else, it will not open on boot.| - - +| w3c | TYPE: Boolean
DEFAULT: FALSE
`w3c: true` | Appium will use the W3C webdriver protocol when it's set to true.| +| autoLaunch | TYPE: Boolean
DEFAULT: TRUE
`autoLaunch: false`| If the user doesn't pass this, the app will start on boot. Else, it will not open on boot.| ### Android - - -| KEY | VALUES | CAPABILITY DESCRIPTION | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| playStoreLogin | TYPE: STRINGS OF HASHMAP
DEFAULT: FALSE
`"playStoreLogin":`
`{"email":user@gmail.com","password":"ejndfdfs"}` | The capability is used to login to Play Store on Android devices.
Conditions to be specified:
1. The account should not be using any kind 2 factor authentication, otherwise the test can fail.
2. The account should not require you to login using a trusted device using popup or OTP.
3. Since we clean the Device after each session, please make sure you are logging into the account during each session.| +| KEY | VALUES | CAPABILITY DESCRIPTION | +|-----|--------| -----------------------| +| playStoreLogin | TYPE: STRINGS OF HASHMAP
DEFAULT: FALSE
`"playStoreLogin":`
`{"email":user@gmail.com","password":"ejndfdfs"}` | The capability is used to login to Play Store on Android devices.
Conditions to be specified:
1. The account should not be using any kind 2 factor authentication, otherwise the test can fail.
2. The account should not require you to login using a trusted device using popup or OTP.
3. Since we clean the Device after each session, please make sure you are logging into the account during each session.| | appActivity | TYPE: String
`com.lambdatest.proverbial/.home`| Launch the activity directly on the device using the App Activity. **Only for Android**.| | appPackage | TYPE: String
`com.lambdatest.proverbial`| Launch the app directly on the device using the App Package. **Only for Android**.| ### iOS - - -| KEY | VALUES | CAPABILITY DESCRIPTION | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| resignApp | TYPE: BOOLEAN
DEFAULT: True
`resignApp = true` | 1. By default, if this capability is not passed, your app will be re-signed.
2. You can pass "false" as a capability to prevent your apps from being re-signed.
3. This is only for iOS-specific applications and devices | +| KEY | VALUES | CAPABILITY DESCRIPTION | +|-----|--------| -----------------------| +| resignApp | TYPE: BOOLEAN
DEFAULT: True
`resignApp = true` | 1. By default, if this capability is not passed, your app will be re-signed.
2. You can pass "false" as a capability to prevent your apps from being re-signed.
3. This is only for iOS-specific applications and devices | | bundleId | TYPE: String
`com.whatsapp`| Launch the app directly on the device using the Bundle ID. **Only for iOS**.| -| autoDismissAlerts | TYPE: BOOLEAN
DEFAULT: False
`autoDismissAlerts=TRUE`
OR
`autoDismissAlerts=FALSE` | Appium capability to Dismiss alerts/popups on iOS Devices. | -| autoAcceptAlerts | TYPE: BOOLEAN
DEFAULT: True
`autoAcceptAlerts=TRUE`
OR
`autoAcceptAlerts=FALSE` | Appium capability to Accept alerts/popups on iOS Devices. | -| noReset | TYPE: BOOLEAN
DEFAULT: False
`true` | Don't reset app state before this session. See [here](https://appium.readthedocs.io/en/stable/en/writing-running-appium/other/reset-strategies/) for more details. - +| autoDismissAlerts | TYPE: BOOLEAN
DEFAULT: False
`autoDismissAlerts=TRUE`
OR
`autoDismissAlerts=FALSE` | Appium capability to Dismiss alerts/popups on iOS Devices. | +| autoAcceptAlerts | TYPE: BOOLEAN
DEFAULT: True
`autoAcceptAlerts=TRUE`
OR
`autoAcceptAlerts=FALSE` | Appium capability to Accept alerts/popups on iOS Devices. | +| noReset | TYPE: BOOLEAN
DEFAULT: False
`true` | Don't reset app state before this session. See [here](https://appium.readthedocs.io/en/stable/en/writing-running-appium/other/reset-strategies/) for more details. ## Real User conditions - - -| KEY | VALUES | CAPABILITY DESCRIPTION | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| language | TYPE: STRING
`fr` | Language to set for iOS (XCUITest driver only) and Android. | -| locale | TYPE: STRING
`fr_CA, CA` | Locale to set for iOS (XCUITest driver only) and Android. fr_CA format (language code and country name abbreviationfor iOS). CA format (country name abbreviation) for Android.
For more info, [click here.](https://www.lambdatest.com/support/docs/list-of-supported-locales/) | -| disableAnimation | TYPE: BOOLEAN
DEFAULT: False
`disableAnimation = true` | Disable all kinds of animations on the complete device [including all applications] that is running the test.| -| lambdaMaskCommands | TYPE: Array of Strings
DEFAULT: Empty Array
`["setValues", "setCookies", "getCookies"]` | Used to make sure that the values aren't shown on the device. The text could be a Password.| -| timezone | TYPE: String
`timezone=UTC+13:00`
`timezone=UTC-0400` | Used to set the timezone on the device using the UTC Time.
If this capability is not passed, the device will auto update the timezone based on the physical location of the device.| -| geoLocation | TYPE: String
`geoLocation=US`
`geoLocation=FR` | Used to change the geolocation of the device to the location provided.
If this capability is not passed, the device will auto update the Geo Location based on the physical location of the device.| -| enableImageInjection | TYPE: Boolean
DEFAULT: false
`enableImageInjection: true` | Used to enable the Image Injection for the app.
Must send "media" capability along with this capability.| -| media | TYPE: STRING
`media: Path to the image`|Used to provide the media to upload the file to the app for Image Injection. If this capability is not passed, then the no media will be sent to the device.
Must send "enableImageInjection" capability along with this capability.| -location | TYPE: HashMap

Python example:
`location: {"lat": "28.6235192", "long": "77.3662948"}`

For examples in other languages, please head over to [Capability Generator](https://www.lambdatest.com/capabilities-generator/) | Used to change the GPS Geolocation of the device to the location provided.
If this capability is not passed, the device will auto update the Geo Location based on the physical location of the device.
It needs to be passed in a HashMap structure with `lat` & `long` being passed separately. | +| KEY | VALUES | CAPABILITY DESCRIPTION | +|-----|--------| -----------------------| +| language | TYPE: STRING
`fr` | Language to set for iOS (XCUITest driver only) and Android. | +| locale | TYPE: STRING
`fr_CA, CA` | Locale to set for iOS (XCUITest driver only) and Android. fr_CA format (language code and country name abbreviationfor iOS). CA format (country name abbreviation) for Android.
For more info, [click here.](https://www.lambdatest.com/support/docs/list-of-supported-locales/) | +| disableAnimation | TYPE: BOOLEAN
DEFAULT: False
`disableAnimation = true` | Disable all kinds of animations on the complete device [including all applications] that is running the test.| +| lambdaMaskCommands | TYPE: Array of Strings
DEFAULT: Empty Array
`["setValues", "setCookies", "getCookies"]` | Used to make sure that the values aren't shown on the device. The text could be a Password.| +| timezone | TYPE: String
`timezone=UTC+13:00`
`timezone=UTC-0400` | Used to set the timezone on the device using the UTC Time.
If this capability is not passed, the device will auto update the timezone based on the physical location of the device.| +| geoLocation | TYPE: String
`geoLocation=US`
`geoLocation=FR` | Used to change the geolocation of the device to the location provided.
If this capability is not passed, the device will auto update the Geo Location based on the physical location of the device.| +| enableImageInjection | TYPE: Boolean
DEFAULT: false
`enableImageInjection: true` | Used to enable the Image Injection for the app.
Must send "media" capability along with this capability.| +| media | TYPE: STRING
`media: Path to the image`|Used to provide the media to upload the file to the app for Image Injection. If this capability is not passed, then the no media will be sent to the device.
Must send "enableImageInjection" capability along with this capability.| +location | TYPE: HashMap

Python example:
`location: {"lat": "28.6235192", "long": "77.3662948"}`

For examples in other languages, please head over to [Capability Generator](https://www.lambdatest.com/capabilities-generator/) | Used to change the GPS Geolocation of the device to the location provided.
If this capability is not passed, the device will auto update the Geo Location based on the physical location of the device.
It needs to be passed in a HashMap structure with `lat` & `long` being passed separately. | ## Device configuration - - -| KEY | VALUES | CAPABILITY DESCRIPTION | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| autoGrantPermissions | TYPE: BOOLEAN
`autoGrantPermissions=TRUE`
OR
`autoGrantPermissions=FALSE` | Have Appium automatically determine which permissions your app requires and grant them to the app on install. Defaults to false. If noReset is true, this capability doesn't work. +| KEY | VALUES | CAPABILITY DESCRIPTION | +|-----|--------| -----------------------| +| autoGrantPermissions | TYPE: BOOLEAN
`autoGrantPermissions=TRUE`
OR
`autoGrantPermissions=FALSE` | Have Appium automatically determine which permissions your app requires and grant them to the app on install. Defaults to false. If noReset is true, this capability doesn't work. | proxyUrl | TYPE: STRING
`proxyUrl: 192.168.1.1:8080`| Used to change the Proxy Address of the device. Data will pass through the specified proxy address.
If this capability is not passed, then there'll be no proxy being added to the device.| - - ## Network configuration - - -| KEY | VALUES | CAPABILITY DESCRIPTION | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| tunnel | TYPE: BOOLEAN
`tunnel=TRUE`
OR
`tunnel=FALSE` | To test local applications with LambdaTest. | -| tunnelName | TYPE: STRING
`tunnelName=RabbitHole` | Name of the tunnel. | -| dedicatedProxy | TYPE: BOOLEAN
`dedicatedProxy=TRUE`
OR
`dedicatedProxy=FALSE` | Dedicated Proxy. | -| blockDomains | TYPE: Array of Strings
`"blockDomains": ["www.facebook.com", "www.amazon.com"] ` | It is used to block the mentioned domains on the device. +| KEY | VALUES | CAPABILITY DESCRIPTION | +|-----|--------| -----------------------| +| tunnel | TYPE: BOOLEAN
`tunnel=TRUE`
OR
`tunnel=FALSE` | To test local applications with LambdaTest.| +| tunnelName | TYPE: STRING
`tunnelName=RabbitHole` | Name of the tunnel. | +| dedicatedProxy | TYPE: BOOLEAN
`dedicatedProxy=TRUE`
OR
`dedicatedProxy=FALSE` | Dedicated Proxy. | +| blockDomains | TYPE: Array of Strings
`"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 @@ -173,14 +142,8 @@ curl --location 'https://mobile-api.lambdatest.com/mobile-automation/api/v1/sess --header 'Content-Type: application/json' \ --data '{"mode": "offline/online"}' ``` - -
- - - - > Got any questions?
> Please reach out at our window.openLTChatWidget()}>**24x7 Chat Support** or you could also mail us at [support@lambdatest.com](https://support.lambdatest.com/).