- Platform: iOS
- Appium version: 1.9.0
- Emulator: XCode iPhone Simulator
- Client langauage: Java
- OS: OSX
I could not start driver, without error message. Is there anything wrong? I used testNG to set the capabilities by xml. The similar code works well for Android testing on Windows. The Xcode iPhone simulator is launched before running the program. By debugging, I found the setup fails when creating the driver.
.xml: (path to the .app is correct)
Java class:
public class AppiumTestCase {
protected AppiumDriver driver;
…
@Parameters({“port”, “platformName”, “platformVersion”, “deviceName”, “automationName”, “app”, “noReset”})
@BeforeTest
public void setUp(String appiumPort, String platformName, String platformVersion, String deviceName,
String automationName, String app, String noReset) {
System.out.println("[-----------Parameters-----------] port=" + appiumPort);
capabilities.setCapability(“platformName”, platformName);
capabilities.setCapability(“platformVersion”, platformVersion);
capabilities.setCapability(“deviceName”, deviceName);
capabilities.setCapability(“automationName”, automationName);
capabilities.setCapability(“app”, app);
capabilities.setCapability(“noReset”, noReset);
capabilities.setCapability(“showXcodeLog”, true);
capabilities.setCapability(“unicodeKeyboard”, true);
capabilities.setCapability(“resetKeyboard”, true);
System.out.println(capabilities.toString());
try {
System.out.println(driver);
driver = new IOSDriver(new URL(“http://0.0.0.0:”+ appiumPort + “/wd/hub”), capabilities);
System.out.println("driver done "+driver);
wait = new WebDriverWait(driver,15);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (Exception exception) {
exception.printStackTrace();
}
}
Output:
I am in onStart method Login
[-----------Parameters-----------] port=4723
Capabilities [{app=/Users/~/simulator-debug.app, noReset=true, showXcodeLog=true, platformVersion=11.4, automationName=XCUITest, unicodeKeyboard=true, platformName=iOS, deviceName=iPhone 5s, resetKeyboard=true}]
null
I am in onTestStart method login_Email start
I am in onTestSkipped method login_Email skipped
I am in onTestStart method login_MobileNumber start
I am in onTestSkipped method login_MobileNumber skipped
I am in onTestStart method login_WrongPassword start
I am in onTestSkipped method login_WrongPassword skipped
I am in onTestStart method login_WrongUsername start
I am in onTestSkipped method login_WrongUsername skipped
I am in onFinish method Login
iPhone5s
Total tests run: 4, Failures: 0, Skips: 4
Configuration Failures: 1, Skips: 2
ConfigurationFailures: [[TestResult name=setUp status=FAILURE method=AppiumTestCase.setUp(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)[pri:0, instance:tests.LoginTest@12e61fe6] output={null}]]
FailedTests: []