# Mobile Web automation on iOS real device – Safari

**URL:** <https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900>\
**Category:** Tutorials/Documentation\
**Created:** [June 23, 2015, 9:27pm UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900 "2015-06-23T21:27:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AmarnathRayudu](https://discuss.appium.io/user_avatar/discuss.appium.io/amarnathrayudu/32/3340_2.png) [@AmarnathRayudu](https://discuss.appium.io/u/AmarnathRayudu)\
**Post date:** [June 23, 2015, 9:27pm UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/1 "2015-06-23T21:27:17Z")

</div>

As there are a lot of us facing issues with Safari browser automation, I wanted to document the steps that  
help the members to do the browser automation.

1. Pre-requisites:  
a. Xcode installed on Mac OS X.  
b. Device added to Apple developer program  
c. Get SafariLauncher.app([https://github.com/budhash/SafariLauncher](https://github.com/budhash/SafariLauncher))  
d. Launch the SafariLauncher.app on connected device from Xcode.  
e. Install appium (IDE)  
f. Download appium from github ([https://github.com/appium/appium](https://github.com/appium/appium))  
g. Install ios-webkit-debug-proxy … use below command from terminal.  
_Install brew install ios-webkit-debug-proxy_

2. a. Connect the device to your mac and verify the device is shown under Xcode  
b. Launch the app on device from xcode

3. Open appium IDE, add your device details as mentioned in the below screen.

 ![](https://discuss.appium.io/uploads/default/original/2X/2/29b321f8695f9966778a71db6e3b391523433cd3.png)

1. launch ios\_webkit\_debug\_proxy from terminal  

2. Open new terminal window and navigate to your cloned appium source and  
run the command _./bin/ios-webkit-debug-proxy-launcher.js -cUDID -d_ (This is workaround for dubug proxy crash)

 ![](https://discuss.appium.io/uploads/default/original/2X/8/8b8ecf20c55e92ae3ec15182c2414a310fd287b9.png) 

Launch the appium from IDE

You are all set to run your test now.

Below is the standalone TestNG/java file to open google home page.

package vin.automation;

import io.appium.java\_client.AppiumDriver;  
import io.appium.java\_client.ios.IOSDriver;  
import java.net.MalformedURLException;  
import java.net.URL;  
import java.util.concurrent.TimeUnit;  
import org.openqa.selenium.remote.DesiredCapabilities;  
import org.testng.annotations.BeforeClass;  
import org.testng.annotations.Test;

public class VinWebTest {  
AppiumDriver driver;  
DesiredCapabilities capabilities = new DesiredCapabilities();

```
@BeforeClass()
public void init() throws MalformedURLException {
	capabilities.setCapability("platformName", "iOS");
	capabilities.setCapability("deviceName", "iPhone 5s");
	capabilities.setCapability("browser", "safari");
	driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"),
			capabilities);
	driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

@Test
public void googleTest() {
	driver.get("http://www.google.com");
}

```

}

Please let me know if you face any issues, Happy coding.

Thanks,  
Amarnath Rayudu

---

<div class="post-metadata">

**Author:** ![Donald](https://discuss.appium.io/user_avatar/discuss.appium.io/donald/32/1009_2.png) [@Donald](https://discuss.appium.io/u/Donald)\
**Post date:** [June 24, 2015, 2:58am UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/2 "2015-06-24T02:58:43Z")

</div>

Hi Amarnath,  
Really appreciate your initiative. This will definitely help our community and mobile world.

Thanks,  
Donald

---

<div class="post-metadata">

**Author:** ![Amol](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/a4c791/32.png) [@Amol](https://discuss.appium.io/u/Amol)\
**Post date:** [August 3, 2015, 1:46pm UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/3 "2015-08-03T13:46:59Z")

</div>

> [@AmarnathRayudu](#):
>
> driver.get(“[http://www.google.com](http://www.google.com)”);

Hi Amarnath ,

Thanks for sharing the information.  
After configuring everything I am not able to laucnh URL using “driver.get(“[http://www.google.com](http://www.google.com)”);”

can you please help me out?

Thanks,  
Amol

---

<div class="post-metadata">

**Author:** ![Mobile\_Test\_Test](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@Mobile\_Test\_Test](https://discuss.appium.io/u/Mobile_Test_Test)\
**Post date:** [September 9, 2015, 2:33pm UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/4 "2015-09-09T14:33:18Z")

</div>

@AmarnathRayudu Are you able to continuously run SafariBrowser in iOS real device. Like some 100+ testscripts continuosly without any break/stall???

---

<div class="post-metadata">

**Author:** ![vvvvaib](https://discuss.appium.io/letter_avatar_proxy/v4/letter/v/d78d45/32.png) [@vvvvaib](https://discuss.appium.io/u/vvvvaib)\
**Post date:** [September 15, 2015, 1:56pm UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/5 "2015-09-15T13:56:16Z")

</div>

Hi @Mobile_Test_Test ,  
We are also doing automation on real device on iOS on safari, but test execution is not stable. We face issues with stale tabs which remain in the browser in case a script fails. Now we are facing an issue when we try to click an element which opens a new tab. As soon as new tab is opened we see an issue in appium server- The target application appears to have died. Do you have any idea about this issue ?

---

<div class="post-metadata">

**Author:** ![PavithraRavichandran](https://discuss.appium.io/letter_avatar_proxy/v4/letter/p/d2c977/32.png) [@PavithraRavichandran](https://discuss.appium.io/u/PavithraRavichandran)\
**Post date:** [October 16, 2015, 9:56am UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/6 "2015-10-16T09:56:09Z")

</div>

Hi All,

Can any one of you please let me know how to open the safari from Xcode ?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Mukesh\_otwani](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/aca169/32.png) [@Mukesh\_otwani](https://discuss.appium.io/u/Mukesh_otwani)\
**Post date:** [October 16, 2015, 11:05am UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/7 "2015-10-16T11:05:29Z")

</div>

Hi All,

I have gone through the above the Pre-requisites and I have done the same set up but I got stuck @ one step.

These things I have already done - SafariLauncher is installed via XCODE on IPAD Mini Air (9.3) and device is also connected using os-webkit-debug-proxy.

But when I am running test I am getting below exception

==================================================

info: [debug] Error: ENOENT, stat ‘/Applications/Appium.app/Contents/Resources/node\_modules/appium/build/SafariLauncher/SafariLauncher.zip’  
at Error (native)  
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: ENOENT, stat ‘/Applications/Appium.app/Contents/Resources/node\_modules/appium/build/SafariLauncher/SafariLauncher.zip’)”,“errno”:-2,“code”:“ENOENT”,“path”:"/Applications/Appium.app/Contents/Resources/node\_modules/appium/build/SafariLauncher/SafariLauncher.zip",“origValue”:“ENOENT, stat ‘/Applications/Appium.app/Contents/Resources/node\_modules/appium/build/SafariLauncher/SafariLauncher.zip’”},“sessionId”:null}

error: Failed to start an Appium session, err was: Error: ENOENT, stat ‘/Applications/Appium.app/Contents/Resources/node\_modules/appium/build/SafariLauncher/SafariLauncher.zip’

info: \<-- POST /wd/hub/session 500 162.301 ms - 498

===========================================

Can anyone guide me here ??

Thanks & Regards  
Mukesh

---

<div class="post-metadata">

**Author:** ![PavithraRavichandran](https://discuss.appium.io/letter_avatar_proxy/v4/letter/p/d2c977/32.png) [@PavithraRavichandran](https://discuss.appium.io/u/PavithraRavichandran)\
**Post date:** [October 16, 2015, 11:10am UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/8 "2015-10-16T11:10:42Z")

</div>

Hey @Mukesh_otwani, can you please tell me how to do that ? how to get the xcode project and launch it from xcode ?

---

<div class="post-metadata">

**Author:** ![Mukesh\_otwani](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/aca169/32.png) [@Mukesh\_otwani](https://discuss.appium.io/u/Mukesh_otwani)\
**Post date:** [October 16, 2015, 11:17am UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/9 "2015-10-16T11:17:58Z")

</div>

Download XCode and Install it. After installation import the SafariLauncher in xcode and Run it.

Once build is successful, it will installed SafariLauncher in your device

---

<div class="post-metadata">

**Author:** ![yukonpd](https://discuss.appium.io/letter_avatar_proxy/v4/letter/y/50afbb/32.png) [@yukonpd](https://discuss.appium.io/u/yukonpd)\
**Post date:** [October 18, 2015, 6:57pm UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/10 "2015-10-18T18:57:53Z")

</div>

Friends, I did all my setup. That is setting up Safari Launcher and webkit proxy as well. The problem is when I start the test Safari Launcher starts and opens up the browser but no URL launches. Just the [apple.com](http://apple.com) page launches.

The same test runs well on Simulator.

---

<div class="post-metadata">

**Author:** ![mferturk](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/7ab992/32.png) [@mferturk](https://discuss.appium.io/u/mferturk)\
**Post date:** [October 19, 2015, 6:24am UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/11 "2015-10-19T06:24:22Z")

</div>

Hey @yukonpd, you should launch the url from your test scripts, not the SafariLauncher.  
If you would like to change the first launched page from the SafariLauncher, you should open it with Xcode and change the Default Value of Root.plist

---

<div class="post-metadata">

**Author:** ![yukonpd](https://discuss.appium.io/letter_avatar_proxy/v4/letter/y/50afbb/32.png) [@yukonpd](https://discuss.appium.io/u/yukonpd)\
**Post date:** [October 19, 2015, 6:42am UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/12 "2015-10-19T06:42:02Z")

</div>

Thanks @mferturk for your reply,  
I launched the URL from the test scripts itself, below is the snippet:

Web driver class{

```
  private WebDriver setMobileDriver(Map<String, String> selConfig) {

        DesiredCapabilities cap = new DesiredCapabilities();
	String [] appiumDeviceConfig = selConfig.get("mobileDevice").split(":"); 
	cap.setCapability("deviceName", appiumDeviceConfig[0]);
	cap.setCapability("automationName", "Appium");
	cap.setCapability("platformName", "iOS");
	String appiumServerHostUrl = selConfig.get("appiumServer");
	URL appiumServerHost = null;
	try {
		appiumServerHost = new URL(appiumServerHostUrl);
	} catch (MalformedURLException e) {
		e.printStackTrace();
	}
	cap.setJavascriptEnabled(true);
	System.out.println(appiumServerHostUrl);
	AppiumDriver driver=new IOSDriver(appiumServerHost, cap);
	
	try {
		Thread.sleep(30000);
		System.out.println("now entering url");
	} catch (InterruptedException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	driver.get("https://google.com");

```

Just to remind the same lines work on the Simulator, I have appium 3.1.0 version under my POM.xml. Just let me know if you need more info.

---

<div class="post-metadata">

**Author:** ![AmarnathRayudu](https://discuss.appium.io/user_avatar/discuss.appium.io/amarnathrayudu/32/3340_2.png) [@AmarnathRayudu](https://discuss.appium.io/u/AmarnathRayudu)\
**Post date:** [November 2, 2015, 11:06pm UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/13 "2015-11-02T23:06:18Z")

</div>

Please change the url driver.get("

## [https://google.com](https://google.com)

"); to

## [https://www.google.com/](https://www.google.com/)

---

<div class="post-metadata">

**Author:** ![bhaskar123](https://discuss.appium.io/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bhaskar123](https://discuss.appium.io/u/bhaskar123)\
**Post date:** [November 3, 2015, 12:28pm UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/14 "2015-11-03T12:28:04Z")

</div>

Hi Friends,

My mobile application is a iOS Native app. Please go through the below steps

1. After Launching the app there is a button called Forgot Your PIN
2. When we click on Forgot Your PIN button.
3. The application will redirect to a Safari Web page where I have the below fields.
4. Mobile Number, Last Name and Data of Birth Picker.
5. I am unable to tap or select Mobile Number field by using Tap feature of Safari browser using Appium Inspector.

So please someone help me how to tap or select Mobile number field of a browser.

---

<div class="post-metadata">

**Author:** ![Hung\_Pham](https://discuss.appium.io/letter_avatar_proxy/v4/letter/h/5daacb/32.png) [@Hung\_Pham](https://discuss.appium.io/u/Hung_Pham)\
**Post date:** [November 4, 2015, 12:13pm UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/15 "2015-11-04T12:13:06Z")

</div>

Hi yukonpd,

I have the same issue with you.  
Did you solve it? Could you share for us your solution?

---

<div class="post-metadata">

**Author:** ![Hung\_Pham](https://discuss.appium.io/letter_avatar_proxy/v4/letter/h/5daacb/32.png) [@Hung\_Pham](https://discuss.appium.io/u/Hung_Pham)\
**Post date:** [November 4, 2015, 12:19pm UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/16 "2015-11-04T12:19:44Z")

</div>

Hi otwani

I have the same issue with you.  
Did you solve it? Could you share for us your solution?

---

<div class="post-metadata">

**Author:** ![bhaskar123](https://discuss.appium.io/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bhaskar123](https://discuss.appium.io/u/bhaskar123)\
**Post date:** [November 24, 2015, 10:16am UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/17 "2015-11-24T10:16:02Z")

</div>

Hi Friends,

No till now I did not get any solution, if anything is there i will let you know guys.

Thanking you,  
Bhaskar.M

---

<div class="post-metadata">

**Author:** ![akashdeep234](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@akashdeep234](https://discuss.appium.io/u/akashdeep234)\
**Post date:** [December 2, 2015, 7:36am UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/18 "2015-12-02T07:36:48Z")

</div>

Hi, I am facing issue with safari on real device. SafariLauncher opens the safari browser on device but did not hit my URL.  
set following capabilities  
deviceUDID= xxxxxx  
bundleid= com.apple.mobilesafari  
appium-version =1.4.11  
browserName =Safari  
platformName =iOS  
deviceName =iPhone 6  
platformVersion =8.4

---

<div class="post-metadata">

**Author:** ![Chetan\_A\_G](https://discuss.appium.io/letter_avatar_proxy/v4/letter/c/8c91f0/32.png) [@Chetan\_A\_G](https://discuss.appium.io/u/Chetan_A_G)\
**Post date:** [December 23, 2015, 10:22am UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/19 "2015-12-23T10:22:13Z")

</div>

Hi Mukesh,

I am facing the same issue. could you pls share the solution?

---

<div class="post-metadata">

**Author:** ![binoy\_reach](https://discuss.appium.io/letter_avatar_proxy/v4/letter/b/6bbea6/32.png) [@binoy\_reach](https://discuss.appium.io/u/binoy_reach)\
**Post date:** [December 24, 2015, 11:17pm UTC](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900/20 "2015-12-24T23:17:59Z")

</div>

Hi Mukesh,

I got the same error which you were getting earlier, could you please confirm whether you got a solution for this.

info: --\> POST /wd/hub/session {“desiredCapabilities”:{“appium-version”:“1.4.13”,“platformName”:“iOS”,“deviceName”:“Bin\_iPhone”,“udid”:“1f789643be7b96813c4d2ae5b037bc27cb1b4a26”,“bundleId”:“com.binoy.safarilauncher”,“browserName”:“safari”,“version”:“8.4.1”}}

info: Client User-Agent string: undefined  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\* NEW SESSION \*\*\*  
info: \*\*\*\* NEW SESSION \*\*\*  
info: \*\*\*\* NEW SESSION \*\*\*  
info: \*\*\*\* NEW SESSION \*\*\*  
info: \*\*\*\* NEW SESSION \*\*\*  
info: \*\*\*\* NEW SESSION \*\*\*  
info: \*\*\*\* NEW SESSION \*\*\*  
info: \*\*\*\* NEW SESSION \*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
info: [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. : appium-version, version

**error: Failed to start an Appium session, err was: Error: ENOENT, stat '/Applications/Appium.app/Contents/Resources/node\_modules/appium/build/SafariLauncher/SafariLauncher.zip’**

info: [debug] Configuring Safari session  
info: [debug] Using local .zip from command line: /Applications/Appium.app/Contents/Resources/node\_modules/appium/build/SafariLauncher/SafariLauncher.zip  
info: [debug] Copying local zip to tmp dir  
info: [debug] Got configuration error, not starting session  
info: [debug] Cleaning up appium session  
info: [debug] Error: ENOENT, stat ‘/Applications/Appium.app/Contents/Resources/node\_modules/appium/build/SafariLauncher/SafariLauncher.zip’  
at Error (native)  
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: ENOENT, stat ‘/Applications/Appium.app/Contents/Resources/node\_modules/appium/build/SafariLauncher/SafariLauncher.zip’)”,“errno”:-2,“code”:“ENOENT”,“path”:"/Applications/Appium.app/Contents/Resources/node\_modules/appium/build/SafariLauncher/SafariLauncher.zip",“origValue”:“ENOENT, stat ‘/Applications/Appium.app/Contents/Resources/node\_modules/appium/build/SafariLauncher/SafariLauncher.zip’”},“sessionId”:null}  
info: \<-- POST /wd/hub/session 500 4.849 ms - 498

Thanks  
Bin

[Next page](https://discuss.appium.io/t/mobile-web-automation-on-ios-real-device-safari/4900.md?page=2)
