appium ios自动化This tutorial is to start/set up your environment for iOS Automation. Here, we will be doing it with an Appium desktop instead of appium as an npm package. 本教程旨在启动/设置iOS自动化...
appium ios自动化
This tutorial is to start/set up your environment for iOS Automation. Here, we will be doing it with an Appium desktop instead of appium as an npm package.
Appium Desktop is an app for Mac, Windows, and Linux which gives you the power of the Appium automation server in a beautiful and flexible UI. It is a combination of a few Appium-related tools:
A graphical interface for the Appium Server. You can set options, start/stop the server, see logs, etc… You also don’t need to use Node/NPM to install Appium, as the Node runtime comes bundled with Appium Desktop. Appium服务器的图形界面。 您可以设置选项,启动/停止服务器,查看日志等。您还不需要使用Node / NPM来安装Appium,因为Node运行时与Appium Desktop捆绑在一起。
An Inspector that you can use to look at your app’s elements (Safari/Chrome browser, native or hybrid app), get basic information about them, and perform basic interactions with them. This is useful as a way to learn about Appium or as a way to learn about your app so you can write tests for it. 您可以使用该检查器查看应用程序的元素(Safari / Chrome浏览器,本机或混合应用程序),获取有关它们的基本信息以及与它们进行基本交互。 这对于了解Appium或了解应用程序非常有用,因此您可以为其编写测试。
系统要求 : (System Requirements :)
Mac OS High Sierra (10.13) (or higher) Mac OS High Sierra(10.13)(或更高版本)
Xcode is an integrated development environment (IDE) for macOS containing a suite of software development tools developed by Apple for developing software for macOS, iOS, iPadOS, watchOS, and tvOS. You can install it from here.
ideviceinstaller is a tool to interact with the installation_proxyof an iOS device allowing to install, upgrade, uninstall, archive the iOS applications. In terminal, run the following command :
WebDriverAgent is a WebDriver server implementation for iOS that can be used to remote control iOS devices. It allows you to launch & kill applications, tap & scroll views or confirm view presence on a screen. This makes it a perfect tool for application end-to-end testing or general purpose device automation. It works by linking XCTest.framework and calling Apple's API to execute commands directly on a device. WebDriverAgent is developed and used at Facebook for end-to-end testing and is successfully adopted by Appium.
Before we continue with WebDriverAgent setup, make sure you have the Apple developer Accout. Without the developer account we may not be able to build the WebDriverAgent successfully.
10. Open a terminal and run the following command :
10. 打开一个终端并运行以下命令 :
open /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj
Now you will see Xcode starting with your WebDriverAgent.xcodeproj
现在您将看到以WebDriverAgent.xcodeproj开头的Xcode
Once the Xcode is launched, add you developer credentials to Xcode with the steps below :
启动Xcode后 ,请按照以下步骤将开发人员凭据添加到Xcode中:
Click on the Xcode Menu > Preferences, Alternatively you can also use the below shortcut to go to the preferences
单击Xcode菜单> 首选项 ,或者,您也可以使用以下快捷方式转到首选项
Command + ,
2. Click on the Accounts tab
2.单击帐户选项卡
3. Click on the “+” icon and provide your developer credentials.
3.单击“ +”图标并提供您的开发人员凭据。
Once you have added your account you can then “Download your manual profiles”.
添加帐户后,您可以“下载手动配置文件”。
11. Configuring your WebDriverAgent
11. 配置您的WebDriverAgent
Now that, we have opened the WebDriverAgent project in the xcode and we have added our developer credentials to the Xcode. Lets configure the WebDriverAgent.
Your screen should look something like this now (You may have some errors as well, which will get fixed with the below steps) :
您的屏幕现在应该看起来像这样(您可能还会出现一些错误,将通过以下步骤进行修复):
Xcode Intial Screen Xcode初始画面
Click on the WebDriverAgentRunner in the targets section, you can see that highlighted in the above screenshot. 单击目标部分中的WebDriverAgentRunner,您可以在上面的屏幕截图中看到突出显示的内容。
Click on the “Signing & Capabilities” tab. 单击“签名和功能”选项卡。
Check the “Automatically manage signing” checkbox. 选中“自动管理签名”复选框。
Choose your Team in the Team dropdown. 在团队下拉列表中选择您的团队。
Now, you will notice that the errors are gone. 现在,您将注意到错误已消失。
The last step here is to change the bundle id for the WebDriverAgentRunner, Click on “Build Setting” tab. 这里的最后一步是更改WebDriverAgentRunner的捆绑软件ID,单击“ Build Setting”选项卡。
Search for “Product Bundle Identifier” and replace the value with a bundle identifier of your choice. For ex : “com.<YOUR-ORG>.wda.runner” 搜索“产品捆绑包标识符”,然后将值替换为您选择的捆绑包标识符。 例如:“ com。<YOUR-ORG> .wda.runner”
We are now done with configuring the WebDriverAgent runner lets test this by building it.
现在我们已经完成了配置WebDriverAgent运行器的工作,可以通过构建它来对其进行测试。
Choose the WebDriverAgentRunner as the target application and choose your device as a target device. In this case I chose a simulator and click on the build button “Play Icon”.
Now you will see the message “Build Succeded”. With this the WebDriverAgentRunner setup is complete and you can try restarting the session from your Appium Desktop. (Repeat step 7)
ios自动化环境搭建参考如下两个路径; https://www.cnblogs.com/we8fans/p/7384291.html https://www.cnblogs.com/we8fans/p/10416904.html 一 配置启动项 public class Tester { public static void main(String[] ...
ios ui自动化测试Who knew automated UI Testing could be so easy! Well, I guess Apple did. Automated UI Testing has never been easier with the XCUITest framework for iOS. 谁知道自动化的UI测试是如此简单...