You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For me, it threw a null pointer exception when running in an emulator (log below).
I fixed it by changing dev.takeScreenshot() to takeScreenshot() function, which seems to be a workaround for the emulator.
Perhaps, a better approach would be to change the screenshot taking strategy based on whether PUMA is running inside an emulator or real device. It seems that a good approach for this is to check if the String returned by UIDevice.getProductName() contains 'sdk', in which case it is an emulator. Seems like this will be easy to integrate.
Cheers!
Shauvik
Original log:
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
nsl.stg.tests.LaunchApp:
INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
INSTRUMENTATION_STATUS: test=testMain
INSTRUMENTATION_STATUS: class=nsl.stg.tests.LaunchApp
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1
1413692517161: Traffic: 0
1413692517521: --------------- iter 0
1413692518175: New UIState: [6, 0/4]
1413692518175: UI_LOAD_DONE
1413692518223: Clicking 0
1413692518332: screenshot: FAIL
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
Error in testMain:
java.lang.NullPointerException
at nsl.stg.tests.LaunchApp.dump_screen(LaunchApp.java:484)
at nsl.stg.tests.LaunchApp.testMain(LaunchApp.java:379)
at java.lang.reflect.Method.invokeNative(Native Method)
at nsl.stg.uiautomator.testrunner.MyUiAutomatorTestRunner.start(MyUiAutomatorTestRunner.java:147)
at nsl.stg.uiautomator.testrunner.MyUiAutomatorTestRunner.run(MyUiAutomatorTestRunner.java:82)
at nsl.stg.uiautomator.cmds.MyRunTestCommand.run(MyRunTestCommand.java:73)
at nsl.stg.uiautomator.cmds.MyLauncher.main(MyLauncher.java:65)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
INSTRUMENTATION_STATUS: test=testMain
INSTRUMENTATION_STATUS: class=nsl.stg.tests.LaunchApp
INSTRUMENTATION_STATUS: stack=java.lang.NullPointerException
at nsl.stg.tests.LaunchApp.dump_screen(LaunchApp.java:484)
at nsl.stg.tests.LaunchApp.testMain(LaunchApp.java:379)
at java.lang.reflect.Method.invokeNative(Native Method)
at nsl.stg.uiautomator.testrunner.MyUiAutomatorTestRunner.start(MyUiAutomatorTestRunner.java:147)
at nsl.stg.uiautomator.testrunner.MyUiAutomatorTestRunner.run(MyUiAutomatorTestRunner.java:82)
at nsl.stg.uiautomator.cmds.MyRunTestCommand.run(MyRunTestCommand.java:73)
at nsl.stg.uiautomator.cmds.MyLauncher.main(MyLauncher.java:65)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: -1
INSTRUMENTATION_STATUS: stream=
Test results for WatcherResultPrinter=.E
Time: 9.556
FAILURES!!!
Tests run: 1, Failures: 0, Errors: 1
The text was updated successfully, but these errors were encountered:
Hi @shuai-hao and team,
Good job with Puma. It seems to be a nice tool!
For me, it threw a null pointer exception when running in an emulator (log below).
I fixed it by changing dev.takeScreenshot() to takeScreenshot() function, which seems to be a workaround for the emulator.
Perhaps, a better approach would be to change the screenshot taking strategy based on whether PUMA is running inside an emulator or real device. It seems that a good approach for this is to check if the String returned by UIDevice.getProductName() contains 'sdk', in which case it is an emulator. Seems like this will be easy to integrate.
Cheers!
Shauvik
Original log:
The text was updated successfully, but these errors were encountered: