0

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.

  1. The robotium sleep() method is somehow also pausing my asynctask/background thread.
  2. 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.
  3. 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

Dave
  • 3,178
  • 5
  • 28
  • 44
  • Could you please share your code? – Eugene Jun 12 '15 at 09:29
  • Unfortunately I can't share the code in this case because it is for a client. But I can tell you that the code is bug free since without Robotium running it works perfectly. Somehow the interaction with Robotium causes inconsistent timing results like I've described in my question. I'm close to a solution, however what I'm looking for are possible reasons. My hope is that someone who has a better understanding of how Robotium works may have some ideas how the sleep method works, or how it utilizes threading, so a robust solution can be found. Cheers – Dave Jun 12 '15 at 21:36

0 Answers0