gpt4 book ai didi

ios - Appium on ios 真机报sdk iphone模拟器报错

转载 作者:行者123 更新时间:2023-11-28 21:31:13 26 4
gpt4 key购买 nike

friend 们,尝试在 ios 实际设备上运行 appium 脚本,出现以下错误

eclipse 错误:

[TestNG] Running:

/private/var/folders/05/79kfthm94qjd3bngd2l5pv7r0mx69v/T/testng-eclipse--1690789728/testng-customsuite.xml

FAILED CONFIGURATION: @BeforeClass setUpBeforeClass

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 15.00 seconds

Build info: version: '2.51.0', revision: '1af067d', time: '2016-02-05 19:15:17'

System info: host: 'NCA047065', ip: '10.65.210.61', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.5', java.version: '1.7.0_79'

Driver info: org.openqa.selenium.remote.RemoteWebDriver

和.java代码:

import org.junit.BeforeClass;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.Test;
import java.io.File;
import java.net.URL;
import java.util.concurrent.TimeUnit;

public class iOSApptest {

public static RemoteWebDriver driver;


@BeforeClass
public static void setUpBeforeClass() throws Exception
{
File appDir = new File ("//Users//gangaiahl//Appium//jars");
File app = new File (appDir, "Car.ipa");

DesiredCapabilities capabilities = new DesiredCapabilities();

capabilities.setCapability(CapabilityType.BROWSER_NAME, "firefox");
capabilities.setCapability("device", "iPhone 6");
capabilities.setCapability("u_did", "840384833537f40d011032eaaf20a53705a451ce");
capabilities.setCapability("bundle_id", "au.dev.com.onewaytraffic.carsguide");
capabilities.setCapability("deviceName", "Cars_iPhone_6");
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("platformVersion", "9.2");
capabilities.setCapability("app",app.getAbsolutePath());

driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

}

@Test
public void test()
{
System.out.println("Test started");
//System.out.println(" Start to identify a test");
//System.out.println("Test Completed");
}

最佳答案

似乎能力不对

capabilities.setCapability("u_did", "840384833537f40d011032eaaf20a53705a451ce");

尝试使用“udid”键而不是“u_did”

参见 documentation

关于ios - Appium on ios 真机报sdk iphone模拟器报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36025036/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com