I'm trying to get automated blackbox testing of my Android application working.
What is happening is that I run a network operation in an asynctask every x minutes. Once it is finished, the results are put into a list. Without robotium running, this is working perfectly. However with robotium running, let's say I have it set to run every 2 minutes, results might come back in up to 5 min or another random amount of time.
I believe that one of 3 things are happening, however I don't know why or how to fix it.
- The robotium sleep() method is somehow also pausing my asynctask/background thread.
- The robotium methods are somehow interfering with a broadcast receiver I use to notify that new results are in to add them to the list.
- Something else is going on...
Does anyone have any suggestions? My current approach is to just call the sleep method for MUCH longer than is expected, but it seams random whether or not new data will come in. And if it does it is usually MUCH later than it was expected to return. (Remember that it works to the second, perfectly without using robotium.
Cheers