Skip to content

Specifying iOS Device via Options XCUITestOptions().load_capabilities not working #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sachat-hh opened this issue Jan 24, 2025 · 2 comments

Comments

@sachat-hh
Copy link

sachat-hh commented Jan 24, 2025

Hello,

I am trying to select the platform/device via yht python appium test script as specified in the example app with appium python client 2.6.1 and it never grabs the platform from these options always looking into the yml. If I remove the device from the yml then it simply fails, almost as if these options are completely avoided.

from appium import webdriver
from appium.options.ios import XCUITestOptions
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time

# Options are only available since client version 2.3.0
# If you use an older client then switch to desired_capabilities
# instead: https://github.com/appium/python-client/pull/720
options = XCUITestOptions().load_capabilities({
    # Specify device and os_version for testing
    "deviceName": "iPhone 11 Pro",
    "platformName": "ios",
    "platformVersion": "13",

    # Add your caps here
})

driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", options=options)
@ganesh-gsk
Copy link
Contributor

Hi @sachat-hh,

Thank you for reaching out.

If you have similar capabilities mentioned in the test script as well as the browserstack.yml file, the capabilities in the browserstack.yml file take precedence.

When you remove the device from the yml file, it simply fails because we have removed the support for the IOS device 'iPhone 11 Pro' (IOS 13) that is specified in the above test script.

So, please change the device to iPhone 11 instead of iPhone 11 Pro and check if the issue gets resolved for you.

We will make sure to update the script in the repo from our end too.

I hope this helps you.

In case you require any further assistance on this, please feel free to write to us at [email protected].

@ganesh-gsk
Copy link
Contributor

Hi @sachat-hh,

As mentioned previously, we have updated our sample code in the repository now, please let us know if you face this issue again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants