简体   繁体   English

使用带有iOS和appium的Camera捕获图像

[英]Capture image using Camera with iOS and appium

I am automating a test where we need to launch camera app , and capture some images/videos. 我正在自动化测试,我们需要启动camera app并捕获一些图像/视频。 Those captured images/videos will be saved in media library. 这些捕获的图像/视频将保存在媒体库中。 Now Since 1. On real iOS device we can not automate camera app using appium, I thought to write and iOS app which will launch Camera , till this step it is fine, I could launch camera but the capture button not be clicked using appium. 现在,因为1。在真正的iOS设备上,我们无法使用appium自动化照相机应用程序,我想编写一个可以启动Camera的iOS应用程序,直到这一步一切正常,我可以启动照相机,但不能使用appium单击捕获按钮。

Do we have any other way to launch a camera on iOS device using appium and capture some images ? 我们还有其他方法可以使用appium在iOS设备上启动相机并捕获一些图像吗?

Part of Apples security model is the Sandbox. 苹果安全模型的一部分是沙箱。 You can only play within your own sandbox. 您只能在自己的沙箱中玩。 Since the camera app is it's own entity you will not have any control over it once it is launched and can not provide testing code to control it. 由于相机应用程序是它自己的实体,因此一旦启动它,您将无法对其进行任何控制,并且无法提供测试代码来对其进行控制。

You will need to either write your own camera control module which you can then control to take pictures using your test tool or you can pre-populate the device with your required images. 您将需要编写自己的相机控制模块,然后可以使用测试工具进行控制以进行拍照,或者可以用所需的图像预填充设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM