kerou / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

NullPointerException in ScreenshotTaker.getBitmapOfView #538

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Automate an App on a tablet device
2. Turn display (setActivityOrientation())
3. Take a screenshot with robotium

What is the expected output? What do you see instead?
Apparently view.getDrawingCache() returns null in some cases, especially when 
the device has a large screen and the app consumes lots of cpu and memory. 
There is probably not much we can do to prevent this, but it would be great if 
we had some kind of null check in ScreenshotTaker.getBitmapOfView().

What version of the product are you using? On what operating system?
Robotium 4.3 on two tablets (Android 3.2 and Android 4.0).

Please provide any additional information below.

10-23 01:04:17.973 W/dalvikvm(18781): threadid=1: thread exiting with uncaught 
exception (group=0x40a3b1f8)

10-23 01:04:17.983 E/AndroidRuntime(18781): FATAL EXCEPTION: main

10-23 01:04:17.983 E/AndroidRuntime(18781): java.lang.NullPointerException

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
com.jayway.android.robotium.solo.ScreenshotTaker.getBitmapOfView(ScreenshotTaker
.java:221)

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
com.jayway.android.robotium.solo.ScreenshotTaker.access$400(ScreenshotTaker.java
:32)

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
com.jayway.android.robotium.solo.ScreenshotTaker$ScreenshotRunnable.run(Screensh
otTaker.java:332)

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
android.os.Handler.handleCallback(Handler.java:605)

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
android.os.Handler.dispatchMessage(Handler.java:92)

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
android.os.Looper.loop(Looper.java:137)

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
android.app.ActivityThread.main(ActivityThread.java:4424)

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
java.lang.reflect.Method.invokeNative(Native Method)

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
java.lang.reflect.Method.invoke(Method.java:511)

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)

10-23 01:04:17.983 E/AndroidRuntime(18781):     at 
dalvik.system.NativeStart.main(Native Method)

10-23 01:04:17.983 W/ActivityManager(  135): Error in app 
com.xxxxxxxxxxxxxxxxxx running instrumentation 
ComponentInfo{com.xxxxxxxxxxxxxxxxxx/pl.polidea.instrumentation.PolideaInstrumen
tationTestRunner}:

10-23 01:04:17.983 W/ActivityManager(  135):   java.lang.NullPointerException

10-23 01:04:17.983 W/ActivityManager(  135):   java.lang.NullPointerException

10-23 01:04:17.983 I/ActivityManager(  135): Force stopping package 
com.xxxxxxxxxxxxxxxxxx uid=10087

10-23 01:04:17.993 D/AndroidRuntime(18771): Shutting down VM

Original issue reported on code.google.com by miraculi...@gmail.com on 23 Oct 2013 at 6:31

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. It will be fixed in the next release.

Original comment by renasr...@gmail.com on 23 Oct 2013 at 7:28

GoogleCodeExporter commented 9 years ago
Thanks again for reporting this. It has been fixed in 4.3.1.

Original comment by renasr...@gmail.com on 4 Nov 2013 at 4:33