RobotiumTech / robotium

Android UI Testing
http://www.robotium.org
Apache License 2.0
2.86k stars 786 forks source link

Robotium not working with cordova 3.6.3 #757

Closed renas closed 9 years ago

renas commented 9 years ago

From sktniran...@gmail.com on May 19, 2015 00:15:51

I got this error "Test failed to run to completion. Reason: 'Instrumentation run failed due to 'java.lang.ClassCastException''. Check device logcat for details" when i try to record my cordova app using Robotium.

here is my detailed log: 05-19 12:31:17.373: E/AndroidRuntime(1709): java.lang.ClassCastException: com.robotium.recorder.executor.e.a cannot be cast to org.apache.cordova.CordovaChromeClient 05-19 12:31:17.373: E/AndroidRuntime(1709): at org.apache.cordova.CordovaWebView.setWebChromeClient(CordovaWebView.java:316) 05-19 12:31:17.373: E/AndroidRuntime(1709): at com.robotium.recorder.executor.e.l.run(l.java) 05-19 12:31:17.373: E/AndroidRuntime(1709): at android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:1569) 05-19 12:31:17.373: E/AndroidRuntime(1709): at android.os.Handler.handleCallback(Handler.java:605) 05-19 12:31:17.373: E/AndroidRuntime(1709): at android.os.Handler.dispatchMessage(Handler.java:92) 05-19 12:31:17.373: E/AndroidRuntime(1709): at android.os.Looper.loop(Looper.java:137) 05-19 12:31:17.373: E/AndroidRuntime(1709): at android.app.ActivityThread.main(ActivityThread.java:4424) 05-19 12:31:17.373: E/AndroidRuntime(1709): at java.lang.reflect.Method.invokeNative(Native Method) 05-19 12:31:17.373: E/AndroidRuntime(1709): at java.lang.reflect.Method.invoke(Method.java:511) 05-19 12:31:17.373: E/AndroidRuntime(1709): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 05-19 12:31:17.373: E/AndroidRuntime(1709): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 05-19 12:31:17.373: E/AndroidRuntime(1709): at dalvik.system.NativeStart.main(Native Method)

How to solve this issue?

Original issue: http://code.google.com/p/robotium/issues/detail?id=678

renas commented 9 years ago

From renasr...@gmail.com on May 19, 2015 07:25:14

Cordova uses their own custom web client and therefore it is not compatible with Robotium Recorder.

Status: WontFix
Owner: renasr...@gmail.com

renas commented 9 years ago

From nayanshr...@gmail.com on June 04, 2015 01:27:21

So there is no work around by which we can automate Cordova app using Robotium ?