I worked on both that I found: -
1) Robolectric does not support API 19, he mentions in his document - http://robolectric.org/eclipse-quick-start/ . This is an excellent disadvantage.
2) Roboelectric start on JVM not on DVM. Therefore, we cannot find out that at this particular time GPS is on or off, etc. We can only convey our predetermined meaning for it.
3) Writing code in Robolectric is complicated than junit especially for a fragment has a lot of difficulties and problems.
4) Robolectric needs an external jar and configuration, and for the junit test we do not need an external library.
5) Robolectric is faster because it runs on the JVM, but this is a drawback too, we cannot see the user interface on our device, which screen code is being executed.
For Android, I like the jUnit test.
Akanksha Rathore Feb 19 '15 at 9:37 2015-02-19 09:37
source share