【问题标题】:Appium fails launching on iPhone Simulator, success on deviceAppium 在 iPhone 模拟器上启动失败,在设备上成功
【发布时间】:2020-04-03 14:50:50
【问题描述】:
  • Appium v​​1.15.1
  • Mac 10.14.6
  • Xcode 11.2.1
  • Python 测试文件。

我可以在 iPhone 设备上成功运行测试,但在 iPhone 模拟器上不行。

错误:

[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[HTTP] --> GET /status
[HTTP] {}
[debug] [HTTP] No route found. Setting content type to 'text/plain'
[HTTP] <-- GET /status 404 1 ms - 49
[HTTP] 
[WD Proxy] Got an unexpected response with status 404: The URL '/status' did not map to a valid resource

这是 Appium 服务器的详细信息:

Welcome to Appium v1.15.1
[Appium] Non-default server args:
[Appium]   address: 127.0.0.1
[Appium]   port: 8100
[Appium] Appium REST http interface listener started on 127.0.0.1:8100

功能(Python):

def setUp(self):

        app = ('/Users/...app')
        self.driver = webdriver.Remote(
            command_executor='http://127.0.0.1:8100/wd/hub',
            desired_capabilities={
                'app': app,
                'platformName': 'iOS',
                'platformVersion': '13.1',
                'deviceName': 'iPhone Simulator',
                "automationName": "XCUITest",
                "xcodeOrgId": "XXXXXXXX",
                "xcodeSigningId": "iPhone Developer"
            }
        )

有什么建议吗?

【问题讨论】:

  • 您是否尝试使用默认端口 4723
  • @SoorajSathianandan 使用端口 4723 和 UDID,它现在可以工作了!

标签: ios iphone testing appium simulator


【解决方案1】:

尝试以下功能:

desired_capabilities={
            'app': app,
            'platformName': 'iOS',
            'platformVersion': '13.1',
            'deviceName': 'iPhone Simulator',
            'udid': 'unique id of simulator',
            "automationName": "XCUITest"              
        }

udid可以在Simulator>Hardware>Device>Manage Device选择设备,然后就可以看到Identifier了。

端口必须是 4723。

【讨论】:

    【解决方案2】:

    "deviceName", "platformVersion" 能力应该等于设备模拟器名称。

    类似的,

    capabilities.setCapability("deviceName", "iPhone 8 Plus");
    capabilities.setCapability("platformVersion", "12.2");
    capabilities.setCapability("automationName": "XCUITest");
    

    P.S - iPhone X,XS 不适合我[因为我猜是 'X'!]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-19
      • 2014-03-23
      • 2015-10-07
      • 2010-11-01
      • 1970-01-01
      • 2022-11-16
      • 2012-05-16
      • 1970-01-01
      相关资源
      最近更新 更多