Hello all,
I am working on:
- Macbook Pro with OS version 10.9.4.
- Xcode 5.1.1
- Appium Version 1.2.1 (Cygnus)
I have installed appium-1.2.2.dmg and I am using Appium with GUI. The purpose of the test is to start Safari on the iOS Simulator 7.1 and run some tests.
My iOS Settings in Appium are:
- checked “Use Mobile Safari”
- checked “Show Simulator Log”
My General Settings are: - Server Address: 0.0.0.0
- Port: 4723
- checked “Kill Process Using Server Before Launch”
- checked “New Command Timeout 7200 sec”
Issue #1:
When i launch Appium and the iOS Simulator 7.1 is trying to be started, the Appium is saying:
Failed to initialize Remote WebDriver:
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: We don’t have write access to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/Applications/MobileSafari.app, please re-run authorize as temp_admin) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 527 milliseconds Build info: version: ‘2.42.2’, revision: ‘6a6995d31c7c56c340d6f45a76976d43506cd6cc’, time: ‘2014-06-03 10:52:47’ System info: host: ‘SOFM60280092A’, ip: ‘10.55.56.147’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.9.4’, java.version: ‘1.6.0_65’
Driver info: io.appium.java_client.AppiumDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:95)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:49) at
When I go to the /Applications/Xcode.app/Contents/Developer directory and I give full permissions to my user which is temp_admin, I restart the Appium and then the issue #2 comes up.
P.S.#1: In the documentation it’s said that from the Appium GUI I can authorise the application. This is not true. There is no such button or setting in the GUI neither there is such a script in the bib directory of the Appium install folder.
Issue #2:
When the MobileSafari.app is authorized for the temp_admin user, I launch again the Appium application and run my JUnit tests. The error is the following:
iOS Simulator Failed To Install The Application
and from the Appium console:
info: Welcome to Appium v1.2.1 (REV 2a4b624a708e580709006b697dc4c9c4e3007863)
debug: Non-default server args: {“defaultDevice”:true,“showSimulatorLog”:true,“defaultCommandTimeout”:7200}
info: Appium REST http interface listener started on 0.0.0.0:4723
info: LogLevel: debug
info: --> POST /wd/hub/session {“desiredCapabilities”:{“loggingPrefs”:{“driver”:“ALL”},“platform”:“MAC”,“platformVersion”:“7.1”,“platformName”:“iOS”,“deviceName”:“iPhone Simulator”,“browserName”:“Safari”,“version”:""}}
warn: Converting cap loggingPrefs to string, since it was an object. This might be a user error. Original value was: {“driver”:“ALL”}
debug: The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : loggingPrefs, platform, version
debug: Configuring Safari session
debug: Trying to use mobile safari, version 7.1
debug: Looking for built in app MobileSafari
debug: App is not at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/Applications/MobileSafari.app
debug: Couldn’t find original app, but found the temp Appium one so using that
debug: Using mobile safari app at /tmp/Appium-MobileSafari.app
debug: Cleaning mobile safari data files
debug: Determining current user
debug: User is temp_admin
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1-64/Library/Caches/Snapshots/com.apple.mobilesafari
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1-64/Library/Caches/com.apple.mobilesafari/Cache.db*
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1-64/Library/Caches/com.apple.WebAppCache/*.db
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1-64/Library/Safari/*.plist
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1-64/Library/WebKit/LocalStorage/.
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1-64/Library/Library/WebKit/GeolocationSites.plist
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1-64/Library/Cookies/*.binarycookies
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1/Library/Caches/Snapshots/com.apple.mobilesafari
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1/Library/Caches/com.apple.mobilesafari/Cache.db*
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1/Library/Caches/com.apple.WebAppCache/*.db
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1/Library/Safari/*.plist
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1/Library/WebKit/LocalStorage/.
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1/Library/Library/WebKit/GeolocationSites.plist
debug: Deleting /Users/temp_admin/Library/Application\ Support/iPhone\ Simulator/7.1/Library/Cookies/*.binarycookies
debug: Creating new appium session cd5ec19e-65e6-4777-9fdb-6b932750d40d
debug: Removing any remaining instruments sockets
debug: Cleaned up instruments socket /tmp/instruments_sock
debug: Setting Xcode folder
debug: Setting Xcode version
debug: Setting iOS SDK Version
debug: iOS SDK Version set to 7.1
debug: Detecting automation tracetemplate
info: Will try to parse the plist file as XML
debug: Not auto-detecting udid, running on sim
error: Could not parse plist file (as binary) at /tmp/Appium-MobileSafari.app/en.lproj/Localizable.strings
parseFileSync()
is deprecated. Use parseStringSync()
instead.
error: Could not parse plist file (as XML) at /tmp/Appium-MobileSafari.app/en.lproj/Localizable.strings
debug: Not setting locale
debug: Creating instruments
debug: Preparing uiauto bootstrap
debug: Dynamic bootstrap dir: /Users/temp_admin/Library/Application Support/appium/bootstrap
debug: Dynamic env: {“nodePath”:"/Applications/Appium.app/Contents/Resources/node/bin/node",“commandProxyClientPath”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js",“instrumentsSock”:"/tmp/instruments_sock",“interKeyDelay”:null}
debug: Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
#import “/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/uiauto/bootstrap.js”;
bootstrap({
nodePath: “/Applications/Appium.app/Contents/Resources/node/bin/node”,
commandProxyClientPath: “/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js”,
instrumentsSock: “/tmp/instruments_sock”,
interKeyDelay: null,
});
debug: Dynamic bootstrap path: /Users/temp_admin/Library/Application Support/appium/bootstrap/bootstrap-3fd3829137e4c5d0.js
debug: Reusing dynamic bootstrap: /Users/temp_admin/Library/Application Support/appium/bootstrap/bootstrap-3fd3829137e4c5d0.js
debug: Fixing device was changed from:" iPhone - Simulator - iOS 7.1 " to:“iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1”
debug: No iOS / app preferences to set
debug: Starting iOS 7.* simulator log capture
warn: Could not parse app Localizable.strings
debug: User specified default device, letting instruments launch it
debug: Checking whether instruments supports our device string
debug: Getting list of devices instruments supports
debug: Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
debug: Fixing device was changed from:" iPhone - Simulator - iOS 7.1 " to:“iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1”
debug: Fixing device was changed from:" iPhone - Simulator - iOS 7.1 " to:“iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1”
debug: Parsed app Info.plist (as binary)
info: Launching instruments
debug: Wrote new app Info.plist with device type
debug: Getting bundle ID from app
debug: Parsed app Info.plist (as binary)
debug: Not installing to real device since we’re on sim
debug: Starting command proxy.
debug: Instruments socket server started at /tmp/instruments_sock
debug: Starting instruments
debug: Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
debug: Attempting to run app on iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1
debug: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1 /tmp/Appium-MobileSafari.app -e UIASCRIPT /Users/temp_admin/Library/Application Support/appium/bootstrap/bootstrap-3fd3829137e4c5d0.js -e UIARESULTSPATH /tmp/appium-instruments
debug: And extra without-delay env: {“DYLD_INSERT_LIBRARIES”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd/InstrumentsShim.dylib",“LIB_PATH”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd"}
debug: And launch timeouts (in ms): {“global”:90000}
debug: [INST STDERR] Instruments Trace Error : Error Starting Recording
debug: [INSTSERVER] Instruments exited with code 253
debug: Killall instruments
debug: Attempting to retry launching instruments, this is retry #1
debug: Killall iPhoneSimulator
info: Launching instruments
debug: Attempting to run app on iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1
debug: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1 /tmp/Appium-MobileSafari.app -e UIASCRIPT /Users/temp_admin/Library/Application Support/appium/bootstrap/bootstrap-3fd3829137e4c5d0.js -e UIARESULTSPATH /tmp/appium-instruments
debug: And extra without-delay env: {“DYLD_INSERT_LIBRARIES”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd/InstrumentsShim.dylib",“LIB_PATH”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd"}
debug: And launch timeouts (in ms): {“global”:90000}
debug: [INST STDERR] Instruments Trace Error : Error Starting Recording
debug: [INSTSERVER] Instruments exited with code 253
debug: Killall instruments
debug: Attempting to retry launching instruments, this is retry #2
debug: Killall iPhoneSimulator
info: Launching instruments
debug: Attempting to run app on iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1
debug: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1 /tmp/Appium-MobileSafari.app -e UIASCRIPT /Users/temp_admin/Library/Application Support/appium/bootstrap/bootstrap-3fd3829137e4c5d0.js -e UIARESULTSPATH /tmp/appium-instruments
debug: And extra without-delay env: {“DYLD_INSERT_LIBRARIES”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd/InstrumentsShim.dylib",“LIB_PATH”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd"}
debug: And launch timeouts (in ms): {“global”:90000}
debug: [INST STDERR] Instruments Trace Error : Error Starting Recording
debug: [INSTSERVER] Instruments exited with code 253
debug: Killall instruments
debug: Attempting to retry launching instruments, this is retry #3
debug: Killall iPhoneSimulator
info: Launching instruments
debug: Attempting to run app on iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1
debug: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1 /tmp/Appium-MobileSafari.app -e UIASCRIPT /Users/temp_admin/Library/Application Support/appium/bootstrap/bootstrap-3fd3829137e4c5d0.js -e UIARESULTSPATH /tmp/appium-instruments
debug: And extra without-delay env: {“DYLD_INSERT_LIBRARIES”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd/InstrumentsShim.dylib",“LIB_PATH”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd"}
debug: And launch timeouts (in ms): {“global”:90000}
debug: [INST STDERR] Instruments Trace Error : Error Starting Recording
debug: [INSTSERVER] Instruments exited with code 253
debug: Killall instruments
debug: Instruments crashed on startup
My code looks like this:
public static RemoteWebDriver getDriver(
DesiredCapabilities capabilities) throws Exception {
RemoteWebDriver driver = null;
String browserName = (String) capabilities
.getCapability(CapabilityType.BROWSER_NAME);
switch (Browsers.valueOf(browserName.toUpperCase().replaceAll("\\s+",
""))) {
case ANDROID:
driver = new AppiumDriver(getDriverRemoteAccess(),
capabilities);
break;
case IPHONE:
// desiredCapabilities = DesiredCapabilities.iphone();
capabilities.setCapability(
MobileCapabilityType.PLATFORM_VERSION, "7.1");
capabilities.setCapability(
MobileCapabilityType.PLATFORM_NAME, "iOS");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,
"iPhone Simulator");
// iPhone Retina (4-inch) - Simulator - iOS 7.1
capabilities.setCapability(
MobileCapabilityType.BROWSER_NAME, "Safari");
driver = new AppiumDriver(getDriverRemoteAccess(),
capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
if (driver instanceof AppiumDriver) {
System.out.println("Using Appium driver");
}
break;
}
return driver;
}
Please advise…