MAC下搭建appium UI自动化环境详细步骤
来源:互联网 发布:模糊查询的sql语句 编辑:程序博客网 时间:2024/05/19 05:29
- Mac OS X 10.7 或者更高,推荐最新系统
- XCode >= 4.6.3,推荐最新系统
- Apple Developer Tools (iPhone simulator SDK, command line tools)
$ brew -v
Homebrew 0.9.5 (git revision cd4952; last commit 2015-11-12)
如果输入上述命令后,如果没有出现版本信息,说明机器上未安装brew或node。$ node -v
v5.0.0
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install node
git clone git://github.com/ry/node.gitcd node./configuremakesudo make install
npm install -g appium
$ sudo npm uninstall appium -g //卸载appiumunbuild appium@1.3.4$ sudo chmod -R 777 /usr/local //给予非root用户权限$ npm install -g appium //重新安装
git clone git@github.com:appium/python-client.gitcd python-clientpython setup.py install
$ appiuminfo: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)info: Appium REST http interface listener started on 0.0.0.0:4723info: Console LogLevel: debug
$ appium -U xxxxxxxxxxxxxxxxxxx --app xxxxxxxxxxxxinfo: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)info: Appium REST http interface listener started on 0.0.0.0:4723info: [debug] Non-default server args: {"app":"com.netease.erciyuan","udid":"49455326c3b73198d3091b11227d8a333ed9ce31"}info: Console LogLevel: debug
git clone https://github.com/appium/sample-code
cd sample-code/sample-code/apps/TestAppxcodebuild -sdk iphonesimulator
Help -> install new software -> 输入 http://beust.com/eclipse/
资源分享链接:http://pan.baidu.com/s/1bnsb3aB
(1)解压eclipse-testng离线包.zip
(2)将【eclipse-testng离线包/feature】中的文件夹org.testng.eclipse_6.8.6.20130607_0745复制到【MyEclipse安装目录/features】目录下
(3)将【eclipse-testng离线包/org.testng.eclipse_6.8.6.20130607_0745】文件夹复制到【MyEclipse安装目录/plugins】目录下
(4)重启MyEclipse,Windows - show view - TestNG
package com.test.firstest;
import java.io.File;
import java.net.URL;
import java.util.List;
import java.util.concurrent.TimeUnit;
import junit.*;
import junit.framework.TestCase;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class FirstTestCases {
public WebDriver wd = null;
@BeforeMethod
public void setUp() throws Exception {
// set up appium
File appDir = new File("/Users/netease/gacha/ios_automation/sample-code/sample-code/sample-code/apps/TestApp/build/release-iphonesimulator");
File app = new File(appDir, "TestApp.app");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "iPhone 5s");
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("platformVersion", "8.4");
capabilities.setCapability("bundleid", "xxxx");//run on real device
capabilities.setCapability("app", app.getAbsolutePath());
wd = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),
capabilities);
wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
System.out.println("App launched");
}
@AfterMethod
public void tearDown() throws Exception {
wd.quit();
}
@Test
public void testCases() throws InterruptedException {
String myname = "Smriti";
wd.findElement(By.name("Add")).click();
wd.findElement(By.xpath("//textfield[1]")).sendKeys(myname);
wd.findElement(By.name("Save")).click();
Thread.sleep(5000);
// write all your tests here
wd.close();
}
}
- MAC下搭建appium UI自动化环境详细步骤
- MAC下搭建appium UI自动化环境详细步骤
- Mac下搭建appium自动化测试环境
- Mac appium 自动化环境搭建
- mac 下自动化测试appium环境搭建,以及应用
- Mac下Appium环境搭建
- Mac下Appium环境搭建
- Appium环境搭建步骤 For Mac
- mac下appium自动化测试安卓环境的搭建和运行测试
- MAC下的appium环境搭建
- MAC下的appium环境搭建
- 一.Mac下搭建appium环境
- 一、Mac下Appium环境搭建
- 二、Mac下Appium环境搭建
- appium环境搭建步骤
- mac上搭建appium+IOS自动化测试环境
- appium mac 环境搭建
- Appium自动化1-环境搭建
- 【二月英语】—整理心情再出发
- HTML Meta中添加X-UA-Compatible和IE=Edge,chrome=1有什么作用?
- Codeforces Round #401 (Div. 2) 题解
- LeetCode 6. ZigZag Conversion
- 1. Two Sum easy
- MAC下搭建appium UI自动化环境详细步骤
- UVa10288
- 一步一步在Windows中使用MyCat负载均衡 上篇
- java多线程常用关键字与方法介绍(二)
- web.xml中配置乱码过滤器
- [MySQL]--关于索引操作的SQL
- MySchool 04 高级查询 上机题
- NOIP 乘积最大(dp)
- Orcale 游标