How to automate Inbuilt Android Camera App by using Appium?


#1

Hi ,

Could you please let us know, Is there any way to handle Camera App by using Appium.?
I’m unable to identify objects inside Camera (Settings, icons,etc…) in Appium Inspector/UIAutomatorviewer.

Thanks,
Bhaskar.


#2

Any inputs regarding this…!!

Thanks,
Bahskar.


#3

Any updates regarding this ?
Thanks!


#4

Not yet…!!!

Regards,
Bhaskar.


#5

Thanks for quick response :slight_smile: I’m automating the camera app. I need to capture an image from camera for my test app. Actually I’m in the camera screen. I just want to capture the image. I’m using this code driver.sendKeyEvent(KeyEvent.KEYCODE_CAMERA) and it’s not working. Just tapping on screen will capture the image. Is there any solution for this?


#6

Hi,

Have you tried with coordinates…?
driver.tap(fingers, x, y, duration);


#7

Nope, how to get the x and y ?
Thanks
Pavithra


#8

@bhaskar

You can start camera app by using the “appPackage” and “appActivity”.
Once the app starts you have the control on all the elements, use appium inspector.

The above approach worked for me.


#9

One very best approach of handling such type of scenario is :slight_smile:
Install APK Info app, Render the information of Camera App,

Note down the Activity no

driver.startactivity("Activityname,“Activityvalue”)
Then perform the actions whatever u want to execute