[英]Appium fails launching on iPhone Simulator, success on device
I'm able to run the test on iPhone Device successfully, but on iPhone Simulator not.我能够在 iPhone 设备上成功运行测试,但在 iPhone 模拟器上却不能。
Error:错误:
[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
This is the Appium Server details:这是 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
Capabilities (Python):功能(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"
}
)
Any suggestions?有什么建议?
"deviceName", "platformVersion" capability should be equal to the device simulator name. “deviceName”、“platformVersion”功能应该等于设备模拟器名称。
Something like this,像这样的东西,
capabilities.setCapability("deviceName", "iPhone 8 Plus");
capabilities.setCapability("platformVersion", "12.2");
capabilities.setCapability("automationName": "XCUITest");
PS - iPhone X, XS is not working for me [because of the 'X' I guess!] PS - iPhone X、XS 对我不起作用 [因为我猜是“X”!]
Try with the below capabilities:尝试使用以下功能:
desired_capabilities={
'app': app,
'platformName': 'iOS',
'platformVersion': '13.1',
'deviceName': 'iPhone Simulator',
'udid': 'unique id of simulator',
"automationName": "XCUITest"
}
udid can be found in Simulator>Hardware>Device>Manage Device select the device and then you can see the Identifier.可以在Simulator>Hardware>Device>Manage Device 中找到 udid 选择设备,然后您可以看到 Identifier。
Port need to be 4723.端口必须是 4723。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.