{"id":639,"date":"2013-08-02T17:59:21","date_gmt":"2013-08-02T09:59:21","guid":{"rendered":"http:\/\/www.yeetrack.com\/?p=639"},"modified":"2013-09-27T22:36:34","modified_gmt":"2013-09-27T14:36:34","slug":"ios%e3%80%81android%e8%87%aa%e5%8a%a8%e5%8c%96%e6%b5%8b%e8%af%95%e6%a1%86%e6%9e%b6appium%e6%a6%82%e8%bf%b0","status":"publish","type":"post","link":"https:\/\/www.yeetrack.com\/?p=639","title":{"rendered":"IOS\u3001Android\u81ea\u52a8\u5316\u6d4b\u8bd5\u6846\u67b6Appium\u6982\u8ff0"},"content":{"rendered":"<h2>Appium<\/h2>\n<p>Appium\u662f\u4e00\u4e2a\u5f00\u6e90\u3001\u8de8\u5e73\u53f0\u7684\u6d4b\u8bd5\u6846\u67b6\uff0c\u53ef\u4ee5\u7528\u6765\u6d4b\u8bd5\u539f\u751f\u53ca\u6df7\u5408\u7684\u79fb\u52a8\u7aef\u5e94\u7528\u3002Appium\u652f\u6301IOS\u3001Android\u53caFirefoxOS\u5e73\u53f0\u3002Appium\u4f7f\u7528WebDriver\u7684json wire\u534f\u8bae\uff0c\u6765\u9a71\u52a8Apple\u7cfb\u7edf\u7684UIAutomation\u5e93\u3001Android\u7cfb\u7edf\u7684UIAutomator\u6846\u67b6\u3002Appium\u5bf9IOS\u7cfb\u7edf\u7684\u652f\u6301\u5f97\u76ca\u4e8eDan Cuellar's\u5bf9\u4e8eIOS\u81ea\u52a8\u5316\u7684\u7814\u7a76\u3002Appium\u4e5f\u96c6\u6210\u4e86Selendroid\uff0c\u6765\u652f\u6301\u8001android\u7248\u672c\u3002<!--more--><\/p>\n<p>\u4f7f\u7528Appium\u8fdb\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5\u6709\u4e24\u4e2a\u597d\u5904\uff1a<br \/>\n1. Appium\u5728\u4e0d\u540c\u5e73\u53f0\u4e2d\u4f7f\u7528\u4e86\u6807\u51c6\u7684\u81ea\u52a8\u5316APIs\uff0c\u6240\u4ee5\u5728\u8de8\u5e73\u53f0\u65f6\uff0c\u4e0d\u9700\u8981\u91cd\u65b0\u7f16\u8bd1\u6216\u8005\u4fee\u6539\u81ea\u5df1\u7684\u5e94\u7528\u3002<br \/>\n2. Appium\u652f\u6301Selenium WebDriver\u652f\u6301\u7684\u6240\u6709\u8bed\u8a00\uff0c\u5982java\u3001Object-C\u3001JavaScript\u3001Php\u3001Python\u3001Ruby\u3001C#\u3001Clojure\uff0c\u6216\u8005Perl\u8bed\u8a00\uff0c\u66f4\u53ef\u4ee5\u4f7f\u7528Selenium WebDriver\u7684Api\u3002Appium\u652f\u6301\u4efb\u4f55\u4e00\u79cd\u6d4b\u8bd5\u6846\u67b6\u3002\u5982\u679c\u53ea\u4f7f\u7528Apple\u7684UIAutomation\uff0c\u6211\u4eec\u53ea\u80fd\u7528javascript\u6765\u7f16\u5199\u6d4b\u8bd5\u7528\u4f8b\uff0c\u800c\u4e14\u53ea\u80fd\u7528Instruction\u6765\u8fd0\u884c\u6d4b\u8bd5\u7528\u4f8b\u3002\u540c\u6837\uff0c\u5982\u679c\u53ea\u4f7f\u7528Google\u7684UIAutomation\uff0c\u6211\u4eec\u5c31\u53ea\u80fd\u7528java\u6765\u7f16\u5199\u6d4b\u8bd5\u7528\u4f8b\u3002Appium\u5b9e\u73b0\u4e86\u771f\u6b63\u7684\u8de8\u5e73\u53f0\u81ea\u52a8\u5316\u6d4b\u8bd5\u3002<\/p>\n<h2>Requirements<\/h2>\n<p>\u603b\u4f53\uff1a<\/p>\n<ul>\n<li>IOS\u81ea\u52a8\u5316\u6d4b\u8bd5\u9700\u8981Mac os\u64cd\u4f5c\u7cfb\u7edf\n<ul>\n<li>Mac OS X 10.7\u6216\u8005\u66f4\u9ad8\u7248\u672c\uff0c\u63a8\u835010.8.4\u7248\u672c<\/li>\n<\/ul>\n<\/li>\n<li>Android\u81ea\u52a8\u5316\u6d4b\u8bd5\u53ef\u4ee5\u5728Mac\u3001Linux\u4e0a\u8fdb\u884c\u3002\u5bf9\u4e8eWindows\u5e73\u53f0\u7684\u652f\u6301\u8fd8\u5728beta\u9636\u6bb5<\/li>\n<li>\u9700\u8981\u5b89\u88c5node\u548cnpm\uff08node\u7248\u672c\u9ad8\u4e8e0.8\uff09<\/li>\n<\/ul>\n<p>IOS\u81ea\u52a8\u5316\uff1a<\/p>\n<ul>\n<li>Mac Xcode<\/li>\n<li>Apple\u5f00\u53d1\u8005\u5de5\u5177\uff08iphone\u6a21\u62df\u5668sdk\uff0c\u53ca\u547d\u4ee4\u884c\u5de5\u5177\uff09<br \/>\nAndroid\u81ea\u52a8\u5316\uff1a<\/li>\n<li>Android SDK API\u7248\u672c &gt;= 17,\u5373android\u7248\u672c\u9ad8\u4e8e4.2<\/li>\n<\/ul>\n<h2>\u5feb\u901f\u5165\u95e8<\/h2>\n<p>\u65b9\u68481\uff1a \u4f7f\u7528Appium.app<\/p>\n<ul>\n<li>\u4e0b\u8f7dappium.app\u00a0<a href=\"https:\/\/bitbucket.org\/appium\/appium.app\/downloads\/appium.dmg\">dmg<\/a><\/li>\n<li>\u5728Apple\u7cfb\u7edf\u4e0a\u5b89\u88c5appium.app\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u81ea\u5df1\u7684case<\/li>\n<\/ul>\n<p>\u65b9\u68482\uff1a \u4f7f\u7528node\u4ece\u547d\u4ee4\u884c\u8fd0\u884cappium<\/p>\n<ul>\n<li>\u5b89\u88c5node\u53canpm<\/li>\n<li>\u4e0b\u9762\u547d\u4ee4\u662f\u5728linux\u7cfb\u7edf\u4e2d\u5b89\u88c5appium\n<pre><code>mkdir appium-test &amp;&amp; cd appium-test\nnpm install -g appium  # might have to do this with sudo\nsudo authorize_ios # enable developer use of iOS sim\nnpm install wd\ncurl -O https:\/\/raw.github.com\/appium\/appium\/master\/sample-code\/examples\/node\/simplest.js\nappium &amp;\nnode simplest.js  \n<\/code><\/pre>\n<p>\u4e0b\u9762\u662f\u4e00\u4e9b\u4e0d\u540c\u8bed\u8a00\u7f16\u5199\u7684appium\u7684\u6d4b\u8bd5\u7528\u4f8b<br \/>\nExample Tests:\u00a0<a href=\"https:\/\/github.com\/appium\/appium\/tree\/master\/sample-code\/examples\/node\">Node.js<\/a>\u00a0|\u00a0<a href=\"https:\/\/github.com\/appium\/appium\/tree\/master\/sample-code\/examples\/python\">Python<\/a>\u00a0|\u00a0<a href=\"https:\/\/github.com\/appium\/appium\/tree\/master\/sample-code\/examples\/php\">PHP<\/a>\u00a0|\u00a0<a href=\"https:\/\/github.com\/appium\/appium\/tree\/master\/sample-code\/examples\/ruby\">Ruby<\/a>\u00a0|\u00a0<a href=\"https:\/\/github.com\/appium\/appium\/tree\/master\/sample-code\/examples\/java\">Java<\/a><\/li>\n<\/ul>\n<h2>\u95ee\u9898\u89e3\u51b3<\/h2>\n<p>\u5982\u679c\u4f7f\u7528\u8fc7\u7a0b\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u53c2\u8003<a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/troubleshooting.md\">\u8fd9\u91cc<\/a>\uff0c\u8fd9\u91cc\u5305\u542b\u4e86\u4e00\u4e9b\u5e38\u89c1\u9519\u8bef\u7684\u89e3\u51b3\u65b9\u6cd5\uff0c\u4e5f\u5305\u542bappium\u7ec4\u7ec7\u7684\u8054\u7cfb\u65b9\u6cd5\u3002<\/p>\n<h2>\u4f7f\u7528appium\u7f16\u5199\u6d4b\u8bd5\u7528\u4f8b<\/h2>\n<p>Appium\u652f\u6301<a href=\"https:\/\/github.com\/appium\/appium\/wiki\/JSON-Wire-Protocol:-Supported-Methods\">Selenium WebDriver json wire \u534f\u8bae<\/a>(\u90e8\u5206\u652f\u6301\uff0c\u975e\u5168\u90e8\uff09<\/p>\n<p>appium\u5b9a\u4f4d\u5143\u7d20\u7684\u65b9\u6cd5\u4e5f\u548cwebdriver\u7c7b\u4f3c\uff0c\u4f46\u662f\u4e5f\u4ec5\u652f\u6301webdriver\u4e2d\u7684\u90e8\u5206\u65b9\u6cd5\uff0c\u8be6\u7ec6\u4fe1\u606f\u89c1<a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/finding-elements.md\">\u8fd9\u91cc<\/a>.<\/p>\n<p>Appium\u4e5f\u4e3ajson wire\u534f\u8bae\u63d0\u4f9b\u4e86\u4e00\u4e9b\u62d3\u5c55\uff0c\u6765\u652f\u6301\u667a\u80fd\u624b\u673a\u7684\u624b\u52bf\u52a8\u4f5c\uff0c\u5982tap\uff08\u8f7b\u51fb\uff09\u3001flick\uff0cswipe\uff0c\u66f4\u591a\u4fe1\u606f\u70b9\u51fb<a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/gestures.md\">\u8fd9\u91cc<\/a><\/p>\n<p>Appium\u4e5f\u652f\u6301\u5728\u6df7\u5408\u7684app\u4e2d\uff0c\u81ea\u52a8\u5316\u6d4b\u8bd5web views\uff0c\u53c2\u89c1<a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/hybrid.md\">\u8fd9\u91cc<\/a><\/p>\n<p>Appium \u540c\u65f6\u652f\u6301Android\u548cIOS\u5e73\u53f0\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/running-on-osx.md#ios\">Appium\u81ea\u52a8\u5316\u6d4b\u8bd5Android\u3001IOS\uff0c\u73af\u5883\u642d\u5efa<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/running-on-osx.md#android\">Appium\u81ea\u52a8\u5316\u6d4b\u8bd5Android\uff0c\u73af\u5883\u642d\u5efa<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/running-on-linux.md#android\">Appium\u81ea\u52a8\u5316\u6d4b\u8bd5Android\uff0clinux\u73af\u5883\u642d\u5efa<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/running-tests.md#prep-ios\">Appium\u81ea\u52a8\u5316\u6d4b\u8bd5IOS\uff0c\u76ee\u6807app\u51c6\u5907<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/running-tests.md#preparing-your-app-for-test-android\">Appium\u81ea\u52a8\u5316\u6d4b\u8bd5Android\uff0c\u76ee\u6807app\u51c6\u5907<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/running-tests.md#run-ios\">IOS\u81ea\u52a8\u5316\u7528\u4f8b\u6267\u884c<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/running-tests.md#android-ios\">Android\u81ea\u52a8\u5316\u7528\u4f8b\u6267\u884c<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/appium\/ruby_console\/blob\/master\/osx.md\">\u5728Mac\u7cfb\u7edf\u4e2d\uff0cRuby\u4f7f\u7528appium\u8fdb\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5<\/a><\/li>\n<\/ul>\n<p>Appium\u5168\u90e8\u6587\u6863\uff0c\u70b9\u51fb<a href=\"https:\/\/github.com\/appium\/appium\/blob\/master\/docs\/\">\u8fd9\u91cc<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Appium Appium\u662f\u4e00\u4e2a\u5f00\u6e90\u3001\u8de8\u5e73\u53f0\u7684\u6d4b\u8bd5\u6846\u67b6\uff0c\u53ef\u4ee5\u7528\u6765\u6d4b\u8bd5\u539f\u751f\u53ca\u6df7\u5408\u7684\u79fb\u52a8\u7aef\u5e94\u7528\u3002Appium\u652f\u6301IOS\u3001Android\u53caFirefoxOS\u5e73\u53f0\u3002Appium\u4f7f\u7528WebDriver\u7684json&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[32,33],"tags":[7,16,42,41],"class_list":["post-639","post","type-post","status-publish","format-standard","hentry","category-internet","category-coding","tag-7","tag-16","tag-42","tag-41"],"views":14224,"_links":{"self":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=639"}],"version-history":[{"count":2,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/639\/revisions"}],"predecessor-version":[{"id":641,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/639\/revisions\/641"}],"wp:attachment":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}