Skip to content

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

Open
@sachat-hh

Description

@sachat-hh

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions