简体   繁体   English

如何使用appium将照片等文件上传到ios应用程序

[英]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.

相关问题 我正在尝试使用适用于iOS设备的HTML 5表单从“照片”应用上传视频 - I am trying to upload Video from “Photos” app using Html 5 form for iOS devices 使用Meteor.js和Cordova访问iOS Photos应用程序的照片 - Access Photos of iOS Photos app using Meteor.js and Cordova 如何使用Javascript将照片上传到Facebook? - How to upload photos to facebook using Javascript? phonegap:如何从ios应用程序上载docx,pdf文件 - phonegap : How to upload docx,pdf files from ios app 如何使用适用于iOS appium的UI自动化JavaScript参考获取本机应用程序字体类型或样式 - how to get the native app font type or style using UI Automation JavaScript Reference for iOS appium 使用Eclipse的iOS Appium - Appium for iOS using Eclipse Appium如何检查iOS应用程序的UI以显示视图层次结构? - How does Appium inspect the UI of an iOS app to show the view hierarchy? 如何通过IOS上的本机响应将视频从我的应用下载到照片 - how to download video from my app to photos by react native on IOS 如何使用Appium在iOS设备上执行左键滑动 - How to perform Swipe left on iOS device using Appium 使用表单输入来访问相机并使用Web应用程序立即上传照片 - Using form input to access camera and immediately upload photos using web app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM