I need to automate android native app, which take camera image as input. Hence with appium studio community version is this possible ? Kindly clarify so that I can start implementing with appium studio
Along with the Appium Studio Community Edition installation, it comes with couple of jar files which you can use specifically for this capability.
If you have provided the default location during installation, it should be in the following folder:
Windows: C:\Program Files (x86)\Experitest\AppiumStudio\clients\appium\java/
Mac: /Applications/AppiumStudio/clients/appium/java/
Within this folder you will find a jar file called appium-seetest-extension-11.x.jar.
Once imported to your project, you can do something like this:
dc.setCapability("instrumentApp", true);
driver = new AndroidDriver<>(new URL("http://raheecloud.com:443/wd/hub"), dc);
SeeTestClient client = new SeeTestClient(driver);
client.setProperty("android.instrumentation.camera", "true");
// Steps to navigate into the camera in your Application
client.simulateCapture("C:\Rahee\Desktop\Images\Front_Check.png");
This should inject the image, considering you are meeting the prerequisites:
- Application is installed in instrumented mode
- You are setting android.instrumentation.camera to true as the example above
- The libraries your developers are using for the Camera is supported by us
@rahee I tried with the steps given, but I am getting error as ‘Failed to simulate capture. The application does not support ‘Simulate Capture’)’ Can you please help how to simulate. I have used real device(android).
@rahee I have used the below capabilities:
dc.setCapability(“reportDirectory”, reportDirectory);
dc.setCapability(“reportFormat”, reportFormat);
dc.setCapability(“testName”, testName);
dc.setCapability(MobileCapabilityType.UDID, “emulator-5554”);
dc.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, “com.xx.xxx.android”);
dc.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, “.xx.xx.xxxActivity”);
dc.setCapability(“instrumentApp”, true);
driver = new AndroidDriver<>(new URL(“http://localhost:4723/wd/hub”), dc);
SeeTestClient client = new SeeTestClient(driver);
client.setProperty(“android.instrumentation.camera”, “true”);
client.simulateCapture(“C:/Users/JDILIPK/Workspace/VVIVNN/VIVIN2.png”);
I get the below error when i execute with android real device:
org.openqa.selenium.JavascriptException: javascript error (javascript error. An unknown server-side error occurred. status=‘false’. Failed to complete internal method: ‘simulateCapture args: [C:/Users/JDILIPK/XRDWorkspace/VIN/VIN2.png]’, details: Failed to simulate capture. The application does not support ‘Simulate Capture’) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Can you please help in resolving the issue. What are the changes\requirement we need to do from code and application side.
I am also facing the same issue please update
Hi,
I am having the same issue.
Have you found the solution, can you share with me.
regards