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.
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://learn-automation.com"); // 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.
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
Mukesh Otwani says
Hi Divakar,
Please refer this link https://www.youtube.com/watch?v=4RiieiylcnU&list=PL6flErFppaj20yvWkrYv6yO_I3jJWvYTj
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 ?
Mukesh Otwani says
Hi Aadesh,
We use hybrid framework only for Selenium and for appium both.
Santhoshkumar Muralikrishnan says
Hi Mukesh,
How to run Appium for IOS on windows?
Mukesh Otwani says
Hi Santhosh,
Here you go https://www.youtube.com/watch?v=NUGUrjtYjHY
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
Mukesh Otwani says
Hi Shiva,
For IOS check this https://www.youtube.com/watch?v=ySglJIrDVMQ