I tried to automate a Unity3d game(android apk) with testdroid tool. The problem is, the tool is unable to identify the elements in the game, instead performing "clickOnScreen()", it blindly clicks on the screen
solo.clickOnScreen(solo.toScreenX(0.665f), solo.toScreenY(0.452f));
I am unable to get the required results with this sort of automation.
What is the best tool used for game automation? How does it work?
Can anyone tell me how to automate in testdroid in a better way or suggest another tool which could detect the game element or any other procedure that works well for game automation.
Thanks
From the code example it seems that you are using Robotium test automation framework which isn't really the best fit for testing mobile games (lots of graphical/OpenGL ES content). I would recommend using something more modern (e.g. Appium framework) with some advanced graphical recognition mechanism (e.g. image recognition/OCR feature). Here is one example done for Clash of Clans (by Supercell):
The Basics of Mobile App, Game and Web Testing
and another example for Hill Climb Racing:
How to Use Image Recognition for Mobile Game Testing
Hopefully these helped.