Hi, i am using AppiumForWindows-1.2.4.1, java-client-2.1.0 and Java with eclipse to do automation for a Android devices. I am not able to find a way to click on capture button of the camera.
Is there any shortcut for capture?
As we have for back button “driver.navigate().back();”.
I searched for “if we can detect the camera button on screen of android device”?
Unfortunately, nothing found but for solution, KEYCODE_CAMERA is suggested in most.
Is there any alternative solution?
I want to capture the photo and video but I dont find the element locators there on the screen to proceed.
Tried appium inspector too but no luck so far. Please share the possible solutions.
You using native camera app? Whats the device you testing. So far I haven’t had any problem with native apps (contacts, dialer, camera, etc.). Only problem is that each manufacturer has their own resource ids
For Samsung s5 please use coordinates to click on capture button in camera view.
HashMap<String, Double> map = new HashMap<String, Double>();
map.put(“x”, 0.5);
map.put(“y”, 0.9); // To select Y axis (0.7)
(driver).executeScript(“mobile: tap”, map);
Thread.sleep(5000);
driver.findElement(By.xpath("//android.widget.Button[contains(@resource-id,‘okay’)]")).click();
I m checking the skype app functionality . and trying to change the
profile pic of it. i tried two queries.But android device is not
capturing the image.
The problem we need to resolve is when we capture this photo, it’ll appear 2 button, back button and OK button, and it’s different each other devices, how can we handle it?
I have the same problem now.
Just now I am writing a test that is supposed to activate the camera, take a picture and click On OK button. The problem is that the automation test I write will run on a large number of devices and each has a different OK button ID. Did you solve the problem?
How many # of combinations would you have for devices. Either that will be having OK button or Done or a tick-mark. You can put all such unique attributes in your page object and check if any one of them is available and click on that after taking the picture.
Hi! I am running into the same issue with my tests. I need to take a picture as a part of the process but while testing it on a large range of Android devices/operating systems I am running into a big inconsistency issue. Each device and operating system has different pop ups and different ID’s to confirm the picture. Have you found any solutions?