How to get the current running camera instance and give a particular file as input in IOS Real Device? - automation

The problem
Can I get the current running camera instance and and give a particular file as input in IOS Real Device
Is this possible with appium ?
Please Advise
More Details:
I am trying to feed my camera an image during runtime. So basically my application has a feature: search a product by scanning a barcode, Since I am trying to automate this, I want to provide an image with barcode and have camera take that image while scanning.
Environment
Appium version: 1.3.2
Desktop OS/version used to run Appium: MAC OS High Sierra (10.13.4)
Mobile platform/version under test: iPhone 8 Plus, OS 11.3
Real device or emulator/simulator: REAL DEVICE
Please Advise

Appium is a black-box testing framework, so it cannot set image for your app directly in the runtime.
However, Appium exposes push_file functionality that places a file onto the device in a particular place.
For iOS it works only on Simulators (running Xcode SDK 8.1+)
driver.pushFile(
"/path/to/device/image.jpg",
new File("/Users/dev/files/image.jpg")
);
If your app supports image selection from gallery, you can push file and then select it in the gallery.
In case it doesn't work, you may look into writing tests directly using XCTest/XCUITest framework

Related

ios appium automation queries

Can we perform automation on preinstalled app like Facebook on ios real device using appium without having ipa/app file?
Can we perform automation on real ios device without having developer team id for a ios app for which we have ipa/app file?
Yes, you can specify the app bundleId in the desired capabilities and attach Appium to the pre-installed application.
No. You need to build and sign the appium-webdriveragent app with your developer certificate to be able to install it on the real iOS device.
Yes you can automate pre installed apps in your phone. But make sure following configurations are already done:
"noReset" capability should be set to true. It won't install your app on every run.
You will need apple developer account if you want to automate it on Real Device. If you are running on simulator, developer account is not needed.

How to test mobile apps on different devices

I want to test my IOS,Android and hybrid apps on various virtual devices. Please suggest me a good tool that can perform these functions.
We currently use Genymotion for testing with Android and XCode's simulator for iOS. These will allow you test a wide range of iOS/Android devices.
If you are looking for one tool to test both iOS and Android I believe Visual Studio's Xamarin supports both, there is also a browser based solution with appetize.io. I haven't used either of those so can't comment on if they are any good.
You can make use of chrome developer toolbar it has most of the device options like device horizontal/Vertical, Zoom
You get the different versions along with the different screen sizes in the simulator which you are working.
Eg: IOS(xcode) when you build it you get which version to build when running the application. Same for Android and hybrid apps

Render camera preview in Chrome using Native Client SDK

I'm trying to write ppapi plugin for Chrome which will use webcam (show preview and write file). I have installed NaCl sdk with pepper_35.
There available examples in /examples/api/ folder: media_stream_audio and media_stream_video.
The audio example works fine - requests access to microphone and shows some kind of preview.
The "media_stream_video" example must show web-camera video preview, but when I load example on the local web server (with make serve command), there appears red rect, and Chrome asks for the web camera access. When I click “allow” - webcam indicator lights-up, chrome show that web page uses the web camera, and I see the camera settings icon. But the preview doesn't work, there still red rectangle instead.
I checked this on Windows 8.1, Windows 7 and Mac OS X, with five different webcams, and have no idea what can be wrong.
Maybe someone already encountered with the same problem?
Installing the pepper_37(dev) version of NaCl SDK solved the problem. Looks like it is unstable version currently, but it works.

Installing iOS apps without Apple Developer Program on iOS 7

I'm trying to install my iOS app on to devices running iOS 7.0. I can install them on my iPhone 4 with iOS 5.1 jailbroken. But currently I'm not able to do so on a friend iPad 4 with iOS 7.0.
For installing them on JB devices I'm using JailCoder .
It works without any problem and I can code and compile my test apps, and put them on JB devices without any effort.
Recently trying to investigate possibilities I found an application named PP25 for Windows, it is a chinese application and it is said to be able to install cracked apps on NON-JB devices.
So i tried to see ig it works somehow, I was able to get my apps converted as ipas from my phone and download them to desktop with it, and i can then upload on other JB devices, thanks to a Cydia application named AppSync, pretty good indeed, but I tried and wasn't able to install them on iOS 7.
That was disappointing, I made additional tests and it appears that the PP Assistant application is able to install cracked apps on iOS 7.0 too, but not my unsigned apps (fails to verify the app rights).
Indeed there is a section in the chinese application where you can download and install commercial apps on iOS 7.0, so there must be a trick they use to re-sign the apps to make it appear as it's a legit app and thus be able to upload to the device even if not jailbroken.
If someone has any idea of what they actually do to make this happen, this would be very useful to know to test apps without JB on every device.
Non-jailbroken devices require valid code-signing to execute binaries. Either wait for a jailbreak to surface for iOS7.X, or find a code-signing service (they are available out there).
Using Xcode 7, you can install your app to your device using a freely available Apple ID.
Free On-Device Development
Now everyone can run and test their own app on a device—for free. You can run and debug your own creations on a Mac, iPhone, iPad, iPod touch, or Apple Watch without any fees, and no programs to join. All you need to do is enter your free Apple ID into Xcode. You can even use the same Apple ID you already use for the App Store or iTunes. Once you’ve perfected your app the Apple Developer Program can help you get it on the App Store.
See Launching Your App on Devices for detailed information about installing and running on devices.
Source

Camera API of Corona availability on Windows

I want to make an iphone app in corona which uses camera and audio recorder functionality but as far as i searched out, camera app is not supported on windows OS.
So am I not able to create such app on windows environment using corona SDK and need to switch to MAC OS??
Not being supported on windows means you cannot test on windows. If you test on the iPhone your app will work fine (if you made it correctly of course).
But you should not be developing for iOS on Windows, it is harder to debug, and you cannot upload it to apple store anyway,
You have to be on a Mac to build for iOS devices (or use a service like MacInTheCloud). Windows can only build for Android. You can develop on Windows but when you need to put it on a device, you will have to have access to a Mac.