I am going to write about “How you can install the framework of safari to run appium tests”. If you need run tests in safari of real devices with Appium, you can use this framework for ios devices (Android it is more easier as always). So, you need to have an apple developer account.
-> Plug your device
-> Git clone this project: https://github.com/budhash/SafariLauncher
-> Add your device in your developer apple register.
-> Download your certificate and your mobile provisioning profile after
-> Install your mobile provision in your device (or double touch on the file)
-> Put in blundle id com.safariLauncher.safariLauncher -> inside of the general properties of the project
-> Check if you are deploying in the right version of ios.
-> Run the project
-> Don’t forget to set the capabilities in your automation project:
DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("appium-version", "1.3.1"); capabilities.setCapability("platformName", "iOS"); capabilities.setCapability("deviceName", "Tahir's iPhone"); capabilities.setCapability("udid", "your_udid"); capabilities.setCapability("bundleId", bundle); capabilities.setCapability("browserName", "safari"); driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); driver.get("http://www.google.com"); Thread.sleep(20000);
Once you have deployed the safari launcher to the device, everything should be configured correctly so that the next time you run ./reset.sh on appium, the installation of the safari launcher app should succeed.
See you next week !
9 thoughts on “How to install SafariLauncher to run appium ?”
Why should you use an Apple dev account for testing iOs apps? There are ways to test without a Apple dev-account.
Hi Osman, Anything you want to do at device level either native/hybrid/mobileweb testing you should be part of dev program either as individual or enterprise level. Refer this
Do you not need to specify an app path when running against a physical device? e.g.
Hi William, I found this: Appium will attempt to install this app binary on the appropriate device first. Note that this capability is not required for Android if you specify appPackage and appActivity capabilities
So, seems there is not need to specify any app argument in desired capabilities if you are passing UDID and Bundle ID from Appium.app. But I found some people saying that they had to build the app before with Xcode and others saying that you need set the ipa or the path to run in real devices.
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
Thank you for your reply, it seems that I’m getting closer to finding a solution. At the moment when I’m adding the desired capabilties for browserName ‘Safari’ it fails. If I removed that capability from the set of desired capabilities then the application successfully launches but then fails at the .navigate step. I believe its a a fruitstrap install issue (configuration related issue) but I would be interested to hear if you have seen this before?
Hi William, I have asked to my friend who is working with this everyday and he told me the bundle id is sufficient to identify what app to launch 🙂 Are you running the ios_webkit_debug_proxy against the correct uuid ? ios_webkit_debug_proxy -c 185efa98891a6f9e0d5bac98763d7fc993ec056c:27753 -d
If you don’t have this service running – you’ll be able to launch the browser, but not interact with the web-layer thats more than likely your missing step
Hi Rafaela, thats cracked it. Not needing to run the ios_webkit_debug_proxy via emulation was where I came into difficulties when using a physical device. Thank you!
Hi William, good to know ! Thank you 🙂
I get the following error when I try to run in eclipse
Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.