Appium Tutorials

How to Automate IOS app using Appium Framework in Selenium

Automate ios app using appium

In the previous section, we have already discussed automating native and web application on Android Device using appium and this article will mainly guide you How to Automate IOS app using Appium Framework which runs on safari Browser.

Automate ios app using appium

Appium is one of the popular tools to automate mobile web, native and hybrid application and it has the power of handling basic to complex gesture as well.

Automate ios app using appium

 

 

Installation Steps

1- Java- You can download any version of Java but recommended is Java 8.

2- Eclipse- You can  use any version of Eclipse but latest in Eclipse Neon and trust me it’s more user-friendly.

3- Java-Client- It is jar file which will have all advanced methods for appium(mobile actions)

4- Appium- You need appium server which will redirect all command to the mobile device. You can install this using cmd or you can download dmg file as well.

5- XCode-  Which will help you to run test cases on Emulator and on real devices as well.

I have uploaded the PPT on SlideShare which I used in video

 

Complete video for Automate ios app using appium

 

Program Automate ios app using appium

import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;

import io.appium.java_client.ios.IOSDriver;

public class TestIOSSafariBrowser {

	@Test
	public void startBrowser() throws MalformedURLException {
                
                // Create Object of DesiredCapability class 
		DesiredCapabilities capabilities = new DesiredCapabilities();

                // Set the device Name- You can change based on your requirement
		capabilities.setCapability("deviceName", "iPhone 6");

                // Set the platform name- This will ramain same 
		capabilities.setCapability("platformName", "iOS");
                 
                // This the version- it is important so change it if required 
		capabilities.setCapability("platformVersion", "9.1");

                // set the browser in Emulator
		capabilities.setCapability(CapabilityType.BROWSER_NAME, "safari");

                // pass the capability object and start the session
		IOSDriver driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

                // Open any web application which you want to Test
		driver.get("https://vistasadprojects.com/mukeshotwani-blogs-v2");

                // Perform any operation- In my case I just used title of Page.
		System.out.println("Page title is " + driver.getTitle());

	}

}

 

[thrive_text_block color=”blue” headline=”Some important point- “]

Emulators are slow so have patience it will work but you will get the accurate result (95 %).

If XCode is not starting the Emulator then you can try creating emulator manually first.

[/thrive_text_block]

 

I hope above article helped you. If yes then share with your friends and let me know your thought in the comment section.

 

author-avatar

About Mukesh Otwani

I am Mukesh Otwani working professional in a beautiful city Bangalore India. I completed by BE from RGPV university Bhopal. I have passion towards automation testing since couple of years I started with Selenium then I got chance to work with other tools like Maven, Ant, Git, GitHub, Jenkins, Sikuli, Selenium Builder etc.

8 thoughts on “How to Automate IOS app using Appium Framework in Selenium

  1. Divakar says:

    Hi Mukesh can you please list the steps how to run appium script on ios real device i want to automate safari and setting app

  2. Aadesh Raj says:

    Hi Mukesh,

    One common question in Appium interview is – which framework was implimented in your project ?

    Can you please let us know that which framework is implemented in Mobile automation script ? Can we use same framework which we used in Selenium ?

    1. Hi Aadesh,

      We use hybrid framework only for Selenium and for appium both.

  3. Santhoshkumar Muralikrishnan says:

    Hi Mukesh,

    How to run Appium for IOS on windows?

      1. shiva says:

        Sorry mukesh, didnt get any info on how to run Appium for IOS on windows machine in that video… could you help me out

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.