Appium for IOS Setup

Source: Internet
Author: User
Tags appium testng

Android Client Login: http://www.cnblogs.com/tobecrazy/p/4579631.html

Appium implementation and emptying edittext:http://www.cnblogs.com/tobecrazy/p/4592405.html

Appium Slide Handling: http://www.cnblogs.com/tobecrazy/p/4612133.html

Chromedriver:http://www.cnblogs.com/tobecrazy/p/4836995.html

Appium Nine Gongge unlock China Merchants Bank Mobile Client app:http://www.cnblogs.com/tobecrazy/p/4881390.html

Hybrid app Webview:http://www.cnblogs.com/tobecrazy/p/4905917.html

MAC Prep Environment 1. Jdkinstallation
    • Download JDK for Mac I'm using jdk-7u79-macosx-x64.dmg here.
    • Verifying the installation of the Open Terminal
       java-versionjava Version "1.7.0_79" Java (tm) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot (TM) 64 -bit Server VM (build 24.79-b02, Mixed mode
2. Xcodeinstallation
  • Download Xcode requires an Apple developer account
  • Note the version of Mac OS and the corresponding Xcode to match
  • Create iOS Simulater If this means your iOS device is ready to complete
    youngs-mac:~ root# instruments-s devicesknown Devices:young ' s Mac [564d792f-bb12-9f15-ef80-a723b921b505]resizable IPad (8.4 Simulator) [b477c6f2-f8a9-4ce1-9889-c7bb1518d0b9]resizable iPhone (8.4 Simulator) [ 56007c43-7bab-4c7a-ba5b-e42dee41c4b4]ipad 2 (8.4 Simulator) [D69df503-8f09-47eb-ac67-385ffacc01d1]ipad Air (8.4 Simulator) [D9e1f7ce-a110-4167-b6c8-f50ea83b8cdc]ipad Retina (8.4 Simulator) [c704afe0-bc72-4aaf-8b51-7cee0d021355] IPhone 4s (8.4 Simulator) [D03258c7-8619-4ba2-8eab-6d88eafe641c]iphone 5 (8.4 Simulator) [ 2c39ae81-2b7d-48fc-b6c9-52203a53a560]iphone 5s (8.4 Simulator) [A66f0f82-ab4c-4bac-b466-9bf44fc7b03c]iphone 6 (8.4 Simulator) [C8395c58-5164-406b-9df8-47bae209ec25]iphone 6 Plus (8.4 Simulator) [51c387a1-b77e-4be4-99e0-bba1f95e9789 ]

3. NodeJSinstallation
    • Download and install https://nodejs.org/en/download/

    • Verifying the installation
      npm-version2.14.7

4. Appiuminstallation
    • Download install Appium for MAC https://bitbucket.org/appium/appium.app/downloads/appium-1.4.13.dmg
    • Using Appium-doctor Reference Step 5
5. using Appium Example Demo
    • Download Demo Https://github.com/appium/sample-code
    • Build out the TestApp in the demo.
    • Launch Appium->appium doctor-add app
6.Creating test Cases
    • Open Eclipse and add the following code:

 PackageCom.dbyl.core;Importorg.openqa.selenium.WebElement;ImportOrg.openqa.selenium.remote.CapabilityType;Importorg.openqa.selenium.remote.DesiredCapabilities;ImportOrg.testng.Assert;ImportOrg.testng.annotations.AfterClass;ImportOrg.testng.annotations.BeforeClass;Importorg.testng.annotations.Test;ImportIo.appium.java_client.ios.IOSDriver;ImportJava.io.File;ImportJava.net.URL;ImportJava.util.concurrent.TimeUnit; Public classIostest {PrivateIosdriver driver; Private BooleanIsinstall =true; @BeforeClass (Alwaysrun=true)     Public voidSetUp ()throwsException {//Set up AppiumDesiredcapabilities Capabilities=Newdesiredcapabilities (); Capabilities.setcapability (Capabilitytype.browser_name,"IOS"); Capabilities.setcapability ("PlatformName", "Mac"); Capabilities.setcapability ("DeviceName", "IPhone 6"); Capabilities.setcapability ("Platformversion", "8.4"); //If no need install don ' t add this        if(isinstall) {File classpathroot=NewFile (System.getproperty ("User.dir")); File Appdir=NewFile (Classpathroot, "apps"); File app=NewFile (Appdir, "Testapp.app"); System.out.println ("---->" +App.getabsolutepath ()); Capabilities.setcapability ("App", App.getabsolutepath ()); }        //Support ChineseCapabilities.setcapability ("Unicodekeyboard", "True"); Capabilities.setcapability ("Resetkeyboard", "True"); Driver=NewIosdriver (NewURL ("Http://127.0.0.1:4723/wd/hub"), capabilities); } @Test Public voidLogin () {//Wait for 20sDriver.manage (). Timeouts (). implicitlywait (20, Timeunit.seconds); //Find login userName and password EditTextWebelement inputbox1 =driver.findelementbyname ("TextField1"); Inputbox1.sendkeys ("12"); Webelement Inputbox2=driver.findelementbyname ("TextField2"); Inputbox2.sendkeys ("65"); Webelement Calcbutton=driver.findelementbyxpath ("//uiaapplication[1]/uiawindow[2]/uiabutton[1"));        Calcbutton.click (); Webelement result=driver.findelementbyxpath ("//uiaapplication[1]/uiawindow[2]/uiastatictext[1")); Assert.assertequals (Result.getattribute ("Value"), "77"); } @AfterClass (Alwaysrun=true)     Public voidTearDown ()throwsException {driver.quit (); } }

7. Related Information

Video Tutorial: https://www.youtube.com/watch?v=BULjgsTpw2c

Code: Https://github.com/tobecrazy/appiumDemo

Appium for IOS Setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.