I have issue in running the test with I-os driver
I use putty.exe to start the ios driver located in mac remotely. The start is sucessful.
When i opened the url http://http://10.0.37.32/:5679/wd/hub/status
{
"class": "org.openqa.selenium.remote.Response",
"hCode": 779524993,
"sessionId": null,
"state": null,
"status": 0,
"value": {
"build": {
"revision": "3200431291ad1b53ecb4d539dfde6e56e44a212d",
"time": "20140512-1111",
"version": "0.6.6-SNAPSHOT"
},
"ios": {"simulatorVersion": "7.1"},
"java": {"version": "1.8.0_05"},
"os": {
"arch": "x86_64",
"name": "Mac OS X",
"version": "10.9.4"
},
"state": "success",
"supportedApps": [{
"CFBundleDevelopmentRegion": "English",
"CFBundleDisplayName": "Safari",
"CFBundleExecutable": "MobileSafari",
"CFBundleIcons": {"CFBundlePrimaryIcon": {
"CFBundleIconFiles": [
"icon-spotlight~ipad.png",
"icon-table~ipad.png",
"icon-about~ipad.png",
"icon-table~ipad.png",
"icon-sp...@2x.png",
"icon-...@2x.png",
"icon~ipad.png",
"icon-...@2x.png",
"icon@2x~iphone.png",
"icon@2x~ipad.png"
],
"UIPrenderedIcon": true
}},
"CFBundleIdentifier": "com.apple.mobilesafari",
"CFBundleInfoDictionaryVersion": "6.0",
"CFBundlePackageType": "APPL",
"CFBundleShortVersionString": "7.0",
"CFBundleSignature": "????",
"CFBundleSupportedPlatforms": ["iPhoneSimulator"],
"CFBundleURLTypes~ipad": [
{
"CFBundleURLIsPrivate": true,
"CFBundleURLName": "Web App URL",
"CFBundleURLSchemes": ["webclip"]
},
{
"CFBundleURLName": "Web site URL",
"CFBundleURLSchemes": [
"http",
"https"
]
},
{
"CFBundleURLName": "FTP URL",
"CFBundleURLSchemes": ["ftp"]
},
{
"CFBundleURLName": "Web Search URL",
"CFBundleURLSchemes": ["x-web-search"]
},
{
"CFBundleURLIsPrivate": true,
"CFBundleURLName": "MobileSafari Tab URL",
"CFBundleURLSchemes": ["com-apple-mobilesafari-tab"]
}
],
"CFBundleURLTypes~iphone": [
{
"CFBundleURLIsPrivate": true,
"CFBundleURLName": "Web App URL",
"CFBundleURLSchemes": ["webclip"]
},
{
"CFBundleURLName": "Web site URL",
"CFBundleURLSchemes": [
"http",
"https"
]
},
{
"CFBundleURLName": "Radar URL",
"CFBundleURLSchemes": [
"rdar",
"radar"
]
},
{
"CFBundleURLName": "FTP URL",
"CFBundleURLSchemes": ["ftp"]
},
{
"CFBundleURLName": "Web Search URL",
"CFBundleURLSchemes": ["x-web-search"]
},
{
"CFBundleURLIsPrivate": true,
"CFBundleURLName": "MobileSafari Tab URL",
"CFBundleURLSchemes": ["com-apple-mobilesafari-tab"]
}
],
"CFBundleURLTypes~ipod": [
{
"CFBundleURLIsPrivate": true,
"CFBundleURLName": "Web App URL",
"CFBundleURLSchemes": ["webclip"]
},
{
"CFBundleURLName": "Web site URL",
"CFBundleURLSchemes": [
"http",
"https"
]
},
{
"CFBundleURLName": "Radar URL",
"CFBundleURLSchemes": [
"rdar",
"radar"
]
},
{
"CFBundleURLName": "FTP URL",
"CFBundleURLSchemes": ["ftp"]
},
{
"CFBundleURLName": "Web Search URL",
"CFBundleURLSchemes": ["x-web-search"]
},
{
"CFBundleURLIsPrivate": true,
"CFBundleURLName": "MobileSafari Tab URL",
"CFBundleURLSchemes": ["com-apple-mobilesafari-tab"]
}
],
"CFBundleVersion": "9537.53",
"DTPlatformName": "iphonesimulator",
"DTSDKName": "iphonesimulator7.1",
"LSRequiresIPhoneOS": true,
"MallocBehavior": {"NanoAllocator": false},
"SBMatchingApplicationGenres": [
"Productivity",
"Utilities"
],
"SBUsesNetwork": 3,
"SafariProductVersion": "7.0",
"UIApplicationDisableLegacyAutorotationKey": true,
"UIBackgroundModes": [
"audio",
"continuousFallback"
],
"UIBackgroundStyle~iphone": "UIBackgroundStyleDarkBlur",
"UIDeviceFamily": [
1,
2
],
"UIHasPrefs": true,
"UIStatusBarTintParameters": {"UINavigationBar": {"Style": "UIBarStyleDefault"}},
"UISupportedInterfaceOrientations": [
"UIInterfaceOrientationPortrait",
"UIInterfaceOrientationLandscapeLeft",
"UIInterfaceOrientationLandscapeRight"
],
"UISupportedInterfaceOrientations~ipad": [
"UIInterfaceOrientationPortrait",
"UIInterfaceOrientationLandscapeLeft",
"UIInterfaceOrientationLandscapeRight",
"UIInterfaceOrientationPortraitUpsideDown"
],
"UIViewControllerBasedStatusBarAppearance": true,
"applicationPath": "/Users/vkumar/.ios-driver/safariCopies/safari-7.1.app",
"device": "iphone",
"deviceAlt": [
"iphone",
"ipod",
"ipad"
],
"device_Alt": [
"iphone",
"ipad"
],
"instruments": true,
"resources": {"CFBundleIconFile": "/wd/hub/resources/hash=2134756163"},
"sdkVersion": "7.1",
"sdkVersion_Alt": [
"5.0",
"5.1",
"6.0",
"6.1"
],
"simulator": true,
"supportedLanguages": [
"ar",
"ca",
"cs",
"da",
"de",
"el",
"en",
"en-GB",
"es",
"fi",
"fr",
"he",
"hr",
"hu",
"id",
"it",
"ja",
"ko",
"ms",
"nl",
"no",
"pl",
"pt",
"pt-PT",
"ro",
"ru",
"sk",
"sv",
"th",
"tr",
"uk",
"vi",
"zh-CN",
"zh-TW"
],
"timeHack": false
}]
}
}
when i run the below test:
[TestFixture]
public class IOSTest
{
private RemoteWebDriver _driver;
private const bool simulator = true;
private static DesiredCapabilities DesiredCapabilities()
{
var desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.SetCapability("simulator", simulator);
desiredCapabilities.SetCapability("device", "iphone");
desiredCapabilities.SetCapability("CFBundleName", "Safari");
if (!simulator)
{
//desiredCapabilities.SetCapability("uuid", "98a1d92099a4a2d329ce1387843664f6486fd7e9");
desiredCapabilities.SetCapability("uuid", "0ffce067b733c367b5cef176430d71a0406f4be9");
}
return desiredCapabilities;
}
[SetUp]
public void RunBfrEvryTest()
{
var caps = DesiredCapabilities();
_driver = new RemoteWebDriver(new Uri("http://10.0.37.32:5679/wd/hub"), caps);
}
[TearDown]
public void Teardown()
{
if (_driver != null)
_driver.Quit();
}
[Test]
public void browser_CalculatorTest()
{
_driver.Navigate().GoToUrl("http://google.de/");
}
}
following error occured
SetUp : System.InvalidOperationException : Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'andreass-mbp.as24.local', ip: '10.0.37.32', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.4', java.version: '1.8.0_05'
Driver info: driver.version: unknown (33)
in the jar client i see the following exception.
47:11:731 INFO ApplicationStore.<init> App archive folder:/Users/vkumar/applications
47:14:157 INFO IOSServer.initDriver
Beta features enabled (enabled by -beta flag): false
Simulator enabled : true
Inspector: http://0.0.0.0:5679/inspector/
Tests can access the server at http://0.0.0.0:5679/wd/hub
Server status: http://0.0.0.0:5679/wd/hub/status
Connected devices: http://0.0.0.0:5679/wd/hub/devices/all
Applications: http://0.0.0.0:5679/wd/hub/applications/all
Capabilities: http://0.0.0.0:5679/wd/hub/capabilities/all
Monitoring '/Users/vkumar/applications' for new applications
Archived apps: /Users/vkumar/applications
Build info: ios-driver 0.6.6-SNAPSHOT (built:20140512-1111,sha:3200431291ad1b53ecb4d539dfde6e56e44a212d)
Running on: Mac OS X 10.9.4 (x86_64)
Using java: 1.8.0_05
Using Xcode install: /Applications/Xcode.app
Using instruments: version:5.1.1, build: 55045
Using iOS version 7.1
iOS >= 6.0. Safari and hybrid apps are supported.
Applications :
---------------
CFBundleName=Safari,CFBundleVersion=9537.53,/Users/vkumar/.ios-driver/safariCopies/safari-7.1.app
2014-07-22 10:47:14.301:INFO::jetty-7.x.y-SNAPSHOT
2014-07-22 10:47:14.524:INFO::Started SelectChann...@0.0.0.0:5679
20
47:41:180 INFO InstrumentsApple.moveMobileSafariAppOutOfInstallDir temporarily moving MobileSafari out of the install directory, if you need to restore it yourself use:
$ cp -rf /Users/vkumar/.ios-driver/safariCopies/MobileSafari-7.1.app /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/Applications/MobileSafari.app
48:04:056 WARNING InstrumentsApple.start instruments crashed (20 SEC)
48:05:672 WARNING NewSessionNHandler.safeStart Instruments failed to start in the allocated time ( 20sec):Didn't get the capability back.Most likely, instruments crashed at startup.
48:08:379 INFO InstrumentsApple.moveMobileSafariAppOutOfInstallDir temporarily moving MobileSafari out of the install directory, if you need to restore it yourself use:
$ cp -rf /Users/vkumar/.ios-driver/safariCopies/MobileSafari-7.1.app /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/Applications/MobileSafari.app
48:50:833 WARNING InstrumentsApple.start instruments crashed (40 SEC)
48:50:970 WARNING NewSessionNHandler.safeStart Instruments failed to start in the allocated time ( 40sec):Didn't get the capability back.Most likely, instruments crashed at startup.
48:53:752 INFO InstrumentsApple.moveMobileSafariAppOutOfInstallDir temporarily moving MobileSafari out of the install directory, if you need to restore it yourself use:
$ cp -rf /Users/vkumar/.ios-driver/safariCopies/MobileSafari-7.1.app /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/Applications/MobileSafari.app
49:31:961 WARNING WebKitNotificationListener.onMessage ReportConnectedApplicationsMessage reported 0 app.
49:36:968 WARNING RemoteIOSWebDriver.<init> session created but application size=0
java.lang.NullPointerException
at org.uiautomation.ios.wkrdp.RemoteIOSWebDriver.get(RemoteIOSWebDriver.java:310)
at org.uiautomation.ios.server.services.IOSDualDriver.start(IOSDualDriver.java:109)
at org.uiautomation.ios.server.ServerSideSession.start(ServerSideSession.java:235)
at org.uiautomation.ios.server.command.uiautomation.NewSessionNHandler.safeStart(NewSessionNHandler.java:86)
at org.uiautomation.ios.server.command.uiautomation.NewSessionNHandler.handle(NewSessionNHandler.java:53)
at org.uiautomation.ios.server.command.BaseCommandHandler.handleAndRunDecorators(BaseCommandHandler.java:104)
at org.uiautomation.ios.server.servlet.IOSServlet.getResponse(IOSServlet.java:151)
at org.uiautomation.ios.server.servlet.IOSServlet.process(IOSServlet.java:82)
at org.uiautomation.ios.server.servlet.IOSServlet.doPost(IOSServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:533)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:475)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:920)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:856)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:47)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
at org.eclipse.jetty.server.Server.handle(Server.java:352)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1066)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:212)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:510)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:450)
at java.lang.Thread.run(Thread.java:745)
^CException in thread "Thread-87" java.lang.IllegalStateException: Shutdown in progress
at java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:82)
at java.lang.Runtime.removeShutdownHook(Runtime.java:239)
at org.uiautomation.ios.server.InstrumentsBackedNativeIOSDriver.stop(InstrumentsBackedNativeIOSDriver.java:54)
at org.uiautomation.ios.server.services.IOSDualDriver.stop(IOSDualDriver.java:51)
at org.uiautomation.ios.server.ServerSideSession.stop(ServerSideSession.java:244)
at org.uiautomation.ios.server.ServerSideSession.sessionHasCrashed(ServerSideSession.java:215)
at org.uiautomation.ios.utils.ApplicationCrashListener.hasApplicationCrashed(ApplicationCrashListener.java:45)
at org.uiautomation.ios.utils.ApplicationCrashListener.stdout(ApplicationCrashListener.java:33)
at org.uiautomation.ios.utils.Command.add(Command.java:160)
at org.uiautomation.ios.utils.Command.access$200(Command.java:27)
at org.uiautomation.ios.utils.Command$2.run(Command.java:137)
In the mac machine i see the simulator open and even opened the safari.
Awaiting for your reply
Regards
Vijay
Hi Guys,
No issue it is working now
Regards
Vijay
Hi Vijay,
Please let us know, if you actually did something to resolve issue.
Regards,
Vijay.V
Hi Vijay,
public static void main(String[] args) throws Exception {
// create a selenium desiredCapabilities object with the right values.
DesiredCapabilities cap = IOSCapabilities.iphone("//Users//pradiponecom//Documents//Vishwa//TestApp//InternationalMountains.app", "1.1");
cap.setCapability(IOSCapabilities.BUNDLE_NAME,"InternationalMountains");
cap.setCapability(IOSCapabilities.BUNDLE_VERSION,"2.4");
cap.setCapability(CapabilityType.BROWSER_NAME, "ios");
cap.setCapability(CapabilityType.PLATFORM, "MAC");
cap.setCapability(IOSCapabilities.DEVICE, DeviceType.iphone);
cap.setCapability(IOSCapabilities.SIMULATOR, true);
// start the application
RemoteWebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), cap);
//RemoteWebDriver driver = new RemoteWebDriver(new URL("http://192.168.193.64:3001/wd/hub"), cap);
// check that the 9 mountains of the app are there.
List cells = driver.findElements(By.className("UIATableCell"));
xception in thread "main" org.openqa.selenium.SessionNotCreatedException: {platform=MAC, simulator=true, browserName=ios, timeHack=false, variation=Regular, locale=en_GB, CFBundleName=One.com, device=iphone, CFBundleVersion=2.4, language=en} not found on server.
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.5', java.version: '1.7.0_71'
Driver info: driver.version: unknown
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.5', java.version: '1.7.0_71'
Driver info: driver.version: unknown
Command duration or timeout: 344 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.5', java.version: '1.7.0_71'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:191)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:111)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)
at TestCode.main(TestCode.java:33)
Caused by: org.openqa.selenium.SessionNotCreatedException: {platform=MAC, simulator=true, browserName=ios, timeHack=false, variation=Regular, locale=en_GB, CFBundleName=One.com, device=iphone, CFBundleVersion=2.4, language=en} not found on server.
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.5', java.version: '1.7.0_71'
Driver info: driver.version: unknown
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.5', java.version: '1.7.0_71'
Driver info: driver.version: unknown
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.5', java.version: '1.7.0_71'
Driver info: driver.version: unknown
at org.uiautomation.ios.server.command.uiautomation.NewSessionNHandler.handle(NewSessionNHandler.java:54)
at org.uiautomation.ios.server.command.BaseCommandHandler.handleAndRunDecorators(BaseCommandHandler.java:86)
at org.uiautomation.ios.server.servlet.IOSServlet.getResponse(IOSServlet.java:144)
at org.uiautomation.ios.server.servlet.IOSServlet.process(IOSServlet.java:85)
at org.uiautomation.ios.server.servlet.IOSServlet.doPost(IOSServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:533)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:475)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:920)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:856)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:47)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
at org.eclipse.jetty.server.Server.handle(Server.java:352)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1066)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:510)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:450)
at java.lang.Thread.run(Thread.java:745)
Please help..