Hi Team,
I have been using Appium Studio for testing my IOS application and the tool works really good for all my requirements.
But i have one scenario where in , on click of a button in the app, it opens scanner(Cognex scanner) to scan barcodes and process the result . For this we have used SimulateCapture method to preview barcode image to the scanner but the app is not able to scan the mocked barcode image.
The above process works when we test it manually.
Can you please help me with the above issue , so that i can work with simulateCapture Method? Else can you suggest me the scanner that i can use with Appium Studio and simulate scanning functionality?
Please note, the app is Instrumented by using manual process in this link https://docs.experitest.com/display/TD/SeeTestAutomation+-+Manually+Instrumenting+iOS+Applications
We have added this line to app.properties
instrumentation.use_new_instrumentation=true
Please find my code as below
public class BaseAppiumIOS {
private String reportDirectory = “reports”;
private String reportFormat = “xml”;
private String testName = “Untitled”;
protected IOSDriver driver = null;
private SeeTestClient client;
private String sotFileTEST1="C:\\\\Users\\\\ap250532\\\\Desktop\\\\sot01.JPG";
DesiredCapabilities dc = new DesiredCapabilities();
@Before
public void setUp() throws MalformedURLException {
dc.setCapability("reportDirectory", reportDirectory);
dc.setCapability("reportFormat", reportFormat);
dc.setCapability("testName", testName);
dc.setCapability("android.instrumentation.camera", true);
dc.setCapability("android.instrumentation.security", true);
dc.setCapability(MobileCapabilityType.UDID, "375fb0d5b0fd03df3c73c98bbc3d9040f7988320");
dc.setCapability("instrumentApp", false);
driver = new IOSDriver<>(new URL("http://localhost:4723/wd/hub"), dc);
driver.setLogLevel(Level.INFO);
driver.executeScript("seetest:client.install(\"C:\\\\Users\\\\ap250532\\\\Desktop\\\\MyiScanEnterprise.ipa\", \"false\", \"true\")");
driver.executeScript("seetest:client.launch(\"com.ncr.flms.mrmerchant.enterprise\", \"false\", \"true\")");
client = new SeeTestClient(driver);
}
@Test
public void testUntitled() {
driver.findElement(By.xpath("//*[@text='Scan customer card']")).click();
client.simulateCapture("");
client.simulateCapture(sotFileTEST1);
new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@accessibilityLabel='Accept']")));
}
@After
public void tearDown() {
driver.quit();
}
}