[英]How to upload files like photos to ios app using appium
I am new to appium automation.我是 appium 自动化的新手。 I am trying to automate iOS native app using stack: appium-webdriverio-javascript-jasmine.
我正在尝试使用堆栈自动化 iOS 本机应用程序:appium-webdriverio-javascript-jasmine。
Environment info:环境信息:
Appium desktop APP version (or git revision) that exhibits the issue,出现问题的 Appium 桌面 APP 版本(或 git 修订版),
App Version: 1.20.2应用版本:1.20.2
Desktop OS/version used to run Appium: macOS Big Sur 11.2.3用于运行 Appium 的桌面操作系统/版本:macOS Big Sur 11.2.3
Node.js version (unless using Appium.app|exe): v14.16.1 Node.js 版本(除非使用 Appium.app|exe):v14.16.1
NPM: 6.14.12 NPM:6.14.12
Mobile platform/version under test: 13.3正在测试的移动平台/版本:13.3
Real device or emulator/simulator: emulator xcode/appium真实设备或模拟器/模拟器:emulator xcode/appium
Capabilities:能力:
deviceName: "iPhone 12 Pro Max", platformName: "iOS", platformVersion: "14.2", automationName: "XCUItest"设备名称:“iPhone 12 Pro Max”,平台名称:“iOS”,平台版本:“14.2”,自动化名称:“XCUItest”
Appium CLI or Appium.app|exe: CLI Appium CLI 或 Appium.app|exe:CLI
How to upload files from photos to ios app using appium?如何使用 appium 将照片中的文件上传到 ios 应用程序? App Flow for Upload: There is a button for upload, which onclick/tap, opens the images in the photos app in iOS.
上传的应用程序流程:有一个上传按钮,点击/点击,在 iOS 的照片应用程序中打开图像。
So far I have used push files but it doesnt work.到目前为止,我已经使用了推送文件,但它不起作用。
driver.pushFile("../data/sample.png","");
I am not able to understand what to pass in the second argument, according to my use case, this files needs to be in the photos app, so that on clicking the upload button, i can choose it for upload.我无法理解在第二个参数中传递什么,根据我的用例,这个文件需要在照片应用程序中,以便在单击上传按钮时,我可以选择它进行上传。 How do i ensure this?
我如何确保这一点?
The first parameter in driver.pushFile method is the remote path (in your iOS device) where you want to push the file and the second parameter is the path to your file (which you want to push) within the project directory. driver.pushFile 方法中的第一个参数是要推送文件的远程路径(在 iOS 设备中),第二个参数是项目目录中文件的路径(要推送)。 For ex: src/test/resources/uploadDocuments/abc.pdf.....
例如:src/test/resources/uploadDocuments/abc.pdf.....
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.