Can we do image injection with community edition of appium studio


#1

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


#2

Hi @dilipkumarjayabalu,

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:

  1. Application is installed in instrumented mode
  2. You are setting android.instrumentation.camera to true as the example above
  3. The libraries your developers are using for the Camera is supported by us

#3

@rahee Thanks a lot for the reply. I will try out this solution


#4

@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).


#5

@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.


#6

@rahee Any update on this issue ? Can you please update


#7

I am also facing the same issue please update