I would like to implement test automation for an app running on a Zebra TC75X device (Android OS). The tricky part is the integrated barcode scanner. The device has a hardware button to trigger a barcode scan. How can I automate this? Can this be done with existing frameworks like Appium?

  • 1 - You cannot automate testing. 2 - What risks are you trying to investigate using tools like Appium or Espresso? – João Farias Oct 14 '20 at 10:22

When I worked for an IoT product manufacturer, we used a RaspberryPi running a web service to aide in testing. So in our automated suite we would simply call that API and move on with the rest of the testing. Here is a simple project I have public but you should be able to do the same by looking up Python, Flask, and RPi.GPIO. The RPi runs an API that we would call and would fire the GPIO ports which we had actuators and motors hooked up to. Our sister company had to test card readers so they hooked up the RPi to a Knex Ferris wheel to cycle through the dozen plus cards.

  • 1
    For this purpose even a simple USB controlled relay could be enough – Rsf Oct 15 '20 at 7:14

No. Test automation tools can only simulate hardware. They are not designed to interact with hardware.

That said, if you want to automate tests of the software, you can probably use a tool like Appium to do so. The key thing is to remember that the tests would not cover the actual scanning function because that would need to be simulated. They would only cover the processing of the scanned data.

  • 1
    I'm sorry. I should have been more specific. Of course, automatic push of the hardware button would need some other hardware, for example a hardware robot. But it would be fine for me to simulate the scanning in software. And yes, I'll keep in mind the distortion of the tests by using a simulation. – Markus Neifer Oct 17 '20 at 6:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.