It has been an incredible journey since the start of this pet project from last August.
I was having a casual discussion with Sreeram who is my friend as well as a colleague. He is the go-to guy for anything related to mobile automation in the company where we work. The discussion was around the fact that, not all test cases designed for the POS application are automated. The reason is that many of the test cases are related to different types of cards (credit, debit, gift etc) and its interaction with physical card reader. In order to run those test cases, the cards have to get swiped or scanned on a card reader. And there was no mechanism to achieve that goal. At the end, he asked me, “Why cant we make a robotic arm to do the swipe action?”. It had enough spark to get me started on the project.
Target for Phase 1:
Our goal was to create a robotic arm which can be integrated with an automation test framework (Calabash in our case). The arm should be controlled by the UI automation test scripts.
Before few weeks, we completed the “Phase 1” of this project.
Here are the major logical and physical components in the solution implementation:
- An Arduino Uno V3 board.
- A 3D printed robotic arm controlled by Arduino Uno.
- A sketch (arduino source code) that leverages on an inverse kinematics library.
- A python script that communicate with the sketch over serial port.
- A ruby script that call the above python script during UI automation test.
Here is a quick video of arm in action.
Timeline of major events captured :
1. 00:18 – Start running the Calabash tests from terminal window
2. 00:28 – Mobile app launches on iPod Touch.
3. 00:30 – 00:49 – Mobile app waits for the card swipe action
4. 00:42 – ‘Swipe Now’ button tapped through Calabash
5. 00:48 – Robot arm performs the card swipe action
6. 00:53 – Alert message with card details dismissed through Calabash
7. 00:55 – Mobile app test execution is completed
8. 00:58 – 01:00 – Calabash shows the test results in green on the terminal
This project would not have been possible without the help of few awesome people and super cool initiatives like Arduino.cc.
Credit goes to:
- Sreeram for the igniting question and trusting me throughout.
- danieljabailey, for introducing me to ‘meArm IK Library’ and writing an excellent article on servo calibration.
- aquila12 (Nick), one of the contributor of ‘meArm – Inverse Kinematics‘ library for patiently explaining the logic and configurations whenever I had issues.
- Jazzmyn, author of Giant Robot Arm “meArm” Remix . Thanks to her work, all I did was download the design files from thingiverse and get it printed by Intentional3d.
- Matt of intentional3d, who was really helpful and kind enough to walk me through the 3D printing process. He also helped with selection of material based on my requirements.
- The Arduino project : Shining star of open hardware initiative. The affordability and accessibility of the board that comes with a full fledged ecosystem of support was a big factor for the completion of phase 1.
The exact replica of this arm will cost you around $400 out of which $150 is 3D printing cost. If you have a 3D printer the cost will be even less than $250.
Instructions and Source code:
I will be sharing every technical details and our learnings about this project here soon. The video above is a precursor to it. I am planning to create an instuctables page with all the steps. Here the github repo location with all the source code files including the iOS sample application, calabash scripts, python script along with a collection of arduino sketches.