{"id":779,"date":"2023-02-28T11:04:16","date_gmt":"2023-02-28T03:04:16","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=779"},"modified":"2023-04-05T17:46:01","modified_gmt":"2023-04-05T09:46:01","slug":"appium-automation-testing-appium-introduction","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/28\/appium-automation-testing-appium-introduction\/","title":{"rendered":"Appium\u81ea\u52a8\u5316\u6d4b\u8bd5\uff081\uff09\u2014\u2014 Appium\u4ecb\u7ecd"},"content":{"rendered":"<h2>Appium\u4ecb\u7ecd<\/h2>\n<p>\u5b98\u65b9\u7f51\u7ad9\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/appium.io\/\">http:\/\/appium.io\/<\/a><\/p>\n<p><!-- more --><\/p>\n<h3>\u7279\u70b9<\/h3>\n<p>Appium \u662f\u4e00\u4e2a\u81ea\u52a8\u5316\u6d4b\u8bd5\u5f00\u6e90\u5de5\u5177\uff0c\u652f\u6301 iOS \u5e73\u53f0\u548c Android \u5e73\u53f0\u4e0a\u7684\u539f\u751f\u5e94\u7528\uff0cweb\u5e94\u7528\u548c\u6df7\u5408\u5e94\u7528\u3002<\/p>\n<ul>\n<li>\n<p>\u201c\u79fb\u52a8\u539f\u751f\u5e94\u7528\u201d\u662f\u6307\u90a3\u4e9b\u7528iOS\u6216\u8005 Android SDK \u5199\u7684\u5e94\u7528\uff08Application\u7b80\u79f0app\uff09\u3002<\/p>\n<\/li>\n<li>\n<p>\u201c\u79fb\u52a8web\u5e94\u7528\u201d\u662f\u6307\u4f7f\u7528\u79fb\u52a8\u6d4f\u89c8\u5668\u8bbf\u95ee\u7684\u5e94\u7528\uff08Appium\u652f\u6301iOS\u4e0a\u7684Safari\u548cAndroid\u4e0a\u7684 Chrome\uff09\u3002<\/p>\n<\/li>\n<li>\n<p>\u201c\u6df7\u5408\u5e94\u7528\u201d\u662f\u6307\u539f\u751f\u4ee3\u7801\u5c01\u88c5\u7f51\u9875\u89c6\u56fe\u2014\u2014\u539f\u751f\u4ee3\u7801\u548c web \u5185\u5bb9\u4ea4\u4e92\u3002\u6bd4\u5982\uff0c\u50cf Phonegap\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u4f7f\u7528\u7f51\u9875\u6280\u672f\u5f00\u53d1\u5e94\u7528\uff0c\u7136\u540e\u7528\u539f\u751f\u4ee3\u7801\u5c01\u88c5\uff0c\u8fd9\u4e9b\u5c31\u662f\u6df7\u5408\u5e94\u7528\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u91cd\u8981\u7684\u662f\uff0cAppium\u662f\u4e00\u4e2a\u8de8\u5e73\u53f0\u7684\u5de5\u5177\uff1a\u5b83\u5141\u8bb8\u6d4b\u8bd5\u4eba\u5458\u5728\u4e0d\u540c\u7684\u5e73\u53f0\uff08iOS\uff0cAndroid\uff09\u4f7f\u7528\u540c\u4e00\u5957API\u6765\u5199\u81ea\u52a8\u5316\u6d4b\u8bd5\u811a\u672c\uff0c\u8fd9\u6837\u5927\u5927\u589e\u52a0\u4e86iOS\u548cAndroid\u6d4b\u8bd5\u5957\u4ef6\u95f4\u4ee3\u7801\u7684\u590d\u7528\u6027\u3002<\/p>\n<h3>Appium\u4e0eSelenium<\/h3>\n<p>Appium\u7c7b\u5e93\u5c01\u88c5\u4e86\u6807\u51c6Selenium\u5ba2\u6237\u7aef\u7c7b\u5e93\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u6240\u6709\u5e38\u89c1\u7684JSON\u683c\u5f0fselenium\u547d\u4ee4\u4ee5\u53ca\u989d\u5916\u7684\u79fb\u52a8\u8bbe\u5907\u63a7\u5236\u76f8\u5173\u7684\u547d\u4ee4\uff0c\u5982\u591a\u70b9\u89e6\u63a7\u624b\u52bf\u548c\u5c4f\u5e55\u671d\u5411\u3002<\/p>\n<p>Appium\u5ba2\u6237\u7aef\u7c7b\u5e93\u5b9e\u73b0\u4e86Mobile JSON Wire Protocol\uff08\u4e00\u4e2a\u6807\u51c6\u534f\u8bae\u7684\u5b98\u65b9\u6269\u5c55\u8349\u7a3f\uff09\u548cW3C WebDriver spec\uff08\u4e00\u4e2a\u4f20\u8f93\u4e0d\u53ef\u9884\u77e5\u7684\u81ea\u52a8\u5316\u534f\u8bae\uff0c\u8be5\u534f\u8bae\u5b9a\u4e49\u4e86MultiAction \u63a5\u53e3\uff09\u7684\u5143\u7d20\u3002<\/p>\n<p>Appium\u670d\u52a1\u7aef\u5b9a\u4e49\u4e86\u5b98\u65b9\u534f\u8bae\u7684\u6269\u5c55\uff0c\u4e3aAppium \u7528\u6237\u63d0\u4f9b\u4e86\u65b9\u4fbf\u7684\u63a5\u53e3\u6765\u6267\u884c\u5404\u79cd\u8bbe\u5907\u52a8\u4f5c\uff0c\u4f8b\u5982\u5728\u6d4b\u8bd5\u8fc7\u7a0b\u4e2d\u5b89\u88c5\/\u5378\u8f7dApp\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u6211\u4eec\u9700\u8981Appium\u7279\u5b9a\u7684\u5ba2\u6237\u7aef\uff0c\u800c\u4e0d\u662f\u901a\u7528\u7684Selenium \u5ba2\u6237\u7aef\u3002\u5f53\u7136\uff0cAppium\u5ba2\u6237\u7aef\u7c7b\u5e93\u53ea\u662f\u589e\u52a0\u4e86\u4e00\u4e9b\u529f\u80fd\uff0c\u800c\u5b9e\u9645\u4e0a\u8fd9\u4e9b\u529f\u80fd\u5c31\u662f\u7b80\u5355\u7684\u6269\u5c55\u4e86Selenium \u5ba2\u6237\u7aef\uff0c\u6240\u4ee5\u4ed6\u4eec\u4ecd\u7136\u53ef\u4ee5\u7528\u6765\u8fd0\u884c\u901a\u7528\u7684Selenium\u4f1a\u8bdd\u3002<\/p>\n<h3>\u652f\u6301\u591a\u5e73\u53f0\u3001\u591a\u8bed\u8a00<\/h3>\n<p>Appium\u662f\u8de8\u5e73\u53f0\u7684\uff0c\u53ef\u4ee5\u7528\u5728OSX\uff0cWindows\u4ee5\u53caLinux\u684c\u9762\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002<\/p>\n<p>Appium\u9009\u62e9\u4e86Client\/Server\u7684\u8bbe\u8ba1\u6a21\u5f0f\u3002\u53ea\u8981client\u80fd\u591f\u53d1\u9001http\u8bf7\u6c42\u7ed9server\uff0c\u90a3\u4e48\u7684\u8bddclient\u7528\u4ec0\u4e48\u8bed\u8a00\u6765\u5b9e\u73b0\u90fd\u662f\u53ef\u4ee5\u7684\uff0c\u8fd9\u5c31\u662fAppium\u53caSelenium(WebDriver)\u5982\u4f55\u505a\u5230\u652f\u6301\u591a\u8bed\u8a00\u7684\u539f\u56e0\u3002<\/p>\n<p>Appium\u6269\u5c55\u4e86WebDriver\u7684\u534f\u8bae\uff0c\u6ca1\u6709\u81ea\u5df1\u91cd\u65b0\u53bb\u5b9e\u73b0\u4e00\u5957\u3002\u8fd9\u6837\u7684\u597d\u5904\u662f\u4ee5\u524d\u7684WebDriver API\u80fd\u591f\u76f4\u63a5\u88ab\u7ee7\u627f\u8fc7\u6765\uff0c\u4ee5\u524d\u7684Selenium\uff08WebDriver\uff09\u5404\u79cd\u8bed\u8a00\u7684binding\u90fd\u53ef\u4ee5\u62ff\u6765\u5c31\u7528\uff0c\u7701\u53bb\u4e86\u4e3a\u6bcf\u79cd\u8bed\u8a00\u5f00\u53d1\u4e00\u4e2aclient\u7684\u5de5\u4f5c\u91cf\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u8bed\u8a00\/\u6846\u67b6<\/th>\n<th style=\"text-align: center;\">Github\u5730\u5740<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">Ruby<\/td>\n<td style=\"text-align: center;\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/appium\/ruby_lib\">https:\/\/github.com\/appium\/ruby_lib<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">Python<\/td>\n<td style=\"text-align: center;\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/appium\/python-client\">https:\/\/github.com\/appium\/python-client<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">Java<\/td>\n<td style=\"text-align: center;\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/appium\/java-client\">https:\/\/github.com\/appium\/java-client<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">JavaScript (Node.js)<\/td>\n<td style=\"text-align: center;\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/admc\/wd\">https:\/\/github.com\/admc\/wd<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">Objective C<\/td>\n<td style=\"text-align: center;\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/appium\/selenium-objective-c\">https:\/\/github.com\/appium\/selenium-objective-c<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">PHP<\/td>\n<td style=\"text-align: center;\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/appium\/php-client\">https:\/\/github.com\/appium\/php-client<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">C# (.NET)<\/td>\n<td style=\"text-align: center;\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/appium\/appium-dotnet-driver\">https:\/\/github.com\/appium\/appium-dotnet-driver<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">RobotFramework<\/td>\n<td style=\"text-align: center;\"><a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/jollychang\/robotframework-appiumlibrary\">https:\/\/github.com\/jollychang\/robotframework-appiumlibrary<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Appium\u5de5\u4f5c\u539f\u7406<\/h2>\n<p>\u5728\u5b89\u88c5\u548c\u4ecb\u7ecdAppium\u4e4b\u524d\uff0c\u975e\u5e38\u6709\u5fc5\u8981\u4ecb\u7ecd\u4e00\u4e0bAppium\u662f\u5982\u4f55\u5de5\u4f5c\u7684\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.yezhou.me\/AppBlog\/images\/Android\/appium_principle.png\" alt=\"Appium\u5de5\u4f5c\u539f\u7406\" \/><\/p>\n<p>\u901a\u8fc7\u4e0a\u9762\u4e00\u5f20\u56fe\u7b80\u5355\u5c55\u793a\u4e86Appium\u7684\u5de5\u5177\u539f\u7406\u3002<\/p>\n<ul>\n<li>\n<p>\u9996\u5148\uff0cAppium\u652f\u6301\u591a\u8bed\u8a00\uff0c\u56e0\u4e3a\u5b83\u9488\u5bf9\u6d41\u7684\u51e0\u79cd\u8bed\u8a00\u5206\u522b\u5f00\u53d1\u7684\u76f8\u5e94\u7684Appium\u5e93\u3002\u597d\u5904\u5c31\u662f\u6211\u4eec\u53ef\u4ee5\u9009\u62e9\u81ea\u5df1\u719f\u6089\u7684\u8bed\u8a00\u7f16\u5199Appium\u811a\u672c\u3002<\/p>\n<\/li>\n<li>\n<p>\u5176\u6b21\uff0cAppium\u652f\u6301\u591a\u5e73\u53f0\uff0c\u5305\u62ecMAC\u548cWindows\u3002\u5b83\u9488\u5bf9\u8fd9\u4e24\u5927\u5e73\u53f0\u5f00\u53d1\u4e86appium-Server\u3002<\/p>\n<\/li>\n<li>\n<p>\u6700\u540e\uff0cAppium\u53c8\u540c\u65f6\u652f\u6301Android \u548c iOS\u4e24\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u5f53\u6211\u5728MAC\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7Python\uff08python-client\uff09\u7f16\u5199\u4e86\u4e00\u4e2aAppium\u81ea\u52a8\u5316\u811a\u672c\u5e76\u6267\u884c\uff0c\u8bf7\u6c42\u4f1a\u9996\u5148\u5230 appium.dum \uff08MAC\u4e0b\u7684appium-Server\uff09\uff0cappium-Server\u901a\u8fc7\u89e3\u6790\uff0c\u9a71\u52a8iOS\u8bbe\u5907\u6765\u6267\u884cappium\u81ea\u52a8\u5316\u811a\u672c\u3002<\/p>\n<p>\u6216\u8005\uff0c\u6211\u5728Windows\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7Java\uff08java-client\uff09\u7f16\u5199\u4e86\u4e00\u4e2aAppium\u81ea\u52a8\u5316\u811a\u672c\u5e76\u6267\u884c\uff0c\u8bf7\u6c42\u4f1a\u9996\u5148\u5230 appiumForWindow.zip\uff08Window\u4e0b\u7684appium-Server\uff09\uff0cappium-Server\u901a\u8fc7\u89e3\u6790\uff0c\u9a71\u52a8Android\u865a\u62df\u673a\u6216\u771f\u673a\u6765\u6267\u884cappium\u811a\u672c\u3002<\/p>\n<h2>\u73af\u5883\u53ca\u51c6\u5907<\/h2>\n<h3>\u7f16\u7a0b\u8bed\u8a00<\/h3>\n<ul>\n<li>Java\u73af\u5883<\/li>\n<li>Python\u73af\u5883<\/li>\n<\/ul>\n<h3>Appium<\/h3>\n<p>\u6839\u636e\u7cfb\u7edf\u5e73\u53f0\u9009\u62e9\u5bf9\u5e94\u7684 Appium<\/p>\n<h3>\u6d4b\u8bd5\u8fd0\u884c\u73af\u5883<\/h3>\n<p>\u4f60\u9700\u8981\u4e00\u4e2aAndroid\u6a21\u62df\u5668\uff0c\u6216 \u4e00\u4e2a Android \u624b\u673a\uff0c\u6216 \u4e00\u53f0 iPhone \u624b\u673a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Appium\u4ecb\u7ecd \u5b98\u65b9\u7f51\u7ad9\uff1ahttp:\/\/appium.io\/ \u7279\u70b9 Appium \u662f\u4e00\u4e2a\u81ea\u52a8\u5316\u6d4b\u8bd5\u5f00\u6e90\u5de5\u5177\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[223],"tags":[],"class_list":["post-779","post","type-post","status-publish","format-standard","hentry","category-appium"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=779"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/779\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}