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