Unable to play recorded scripts on an Galaxy S5 with Android 5.0.2.
NoSuchMethodError is thrown when executing a previously recorded test, in IBM MobileFirst Test Workbench.
The same test plays out just fine on other versions of Android.
Following the steps described in https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-6-3/advanced-topics/testing-mobilefirst-mobile-applications-mobile-test-workbench/ I have created my own MobileFirst project and slightly changed the index.html to:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>hw</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<!--
<link rel="shortcut icon" href="images/favicon.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
-->
<link rel="stylesheet" href="css/main.css">
<script>window.$ = window.jQuery = WLJQ;</script>
<script>
function count_rabbits() {
for(var i=1; i<=3; i++) {
alert("Rabbit "+i+" out of the hat!");
}
}
</script>
<script src="js/tracekit.js" type="text/javascript"></script>
<script src="js/MQA.js" type="text/javascript"></script>
</head>
<body style="display: none;">
<!--application UI goes here-->
Hello MobileFirst
<script src="js/initOptions.js"></script>
<script src="js/main.js"></script>
<script src="js/messages.js"></script>
<h2>Press the button to start</h2>
<input type="button" onclick="count_rabbits()" value="Count rabbits!"/>
</body>
</html>
</body>
</html>
I built the application and deployed it on a Galaxy S5 with Android 5.0.2. The application works as expected.
Then I create a Test Workbench project. Using the IBM Rational Test Workbench client from my phone, I upload my application and I record myself opening it, tapping OK three times and then tapping back, then stop the recording and put it in a test.
The test shows up, I can save it and I can launch it.
It runs for a little and it fails with a:
An uncaught exception has been thrown in thread Thread[main,5,main]: NoSuchMethodError: No direct method <init>(Lcom/ibm/rational/test/mobile/android/runtime/webkit/WebViewClientWrapper_rtwrenamed;Ljava/net/HttpURLConnection;Ljava/net/URL;[Ljava/lang/String;Ljava/lang/String;)V in class Lcom/ibm/rational/test/mobile/android/runtime/webkit/WebViewClientWrapper$1; or its super classes (declaration of 'com.ibm.rational.test.mobile.android.runtime.webkit.WebViewClientWrapper$1' appears in /data/app/com.myhw-1/base.apk)
at com.ibm.rational.test.mobile.android.runtime.webkit.WebViewClientWrapper_rtwrenamed.loadRemoteJavascriptsSource(WebViewClientWrapper.java:290)
at com.ibm.rational.test.mobile.android.runtime.webkit.WebViewClientWrapper_rtwrenamed.loadJavaScriptResource(WebViewClientWrapper.java:242)
at com.ibm.rational.test.mobile.android.runtime.webkit.WebViewClientWrapper_rtwrenamed.loadAndInject(WebViewClientWrapper.java:205)
at com.ibm.rational.test.mobile.android.runtime.playback.webkit.RMoTWebDriver$1.run(RMoTWebDriver.java:241)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6066)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
What am I doing wrong?
Windows 7 64 bit with jdk 1.8.0_77
C:\>java -version
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
C:\>javac -version
javac 1.8.0_77
Luna with:
Android DDMS 23.0.7.2120684
Android Development Tools 23.0.7.2120684
Android Hierarchy Viewer 23.0.7.2120684
Android Native Development Tools 23.0.7.2120684
Android Traceview 23.0.7.2120684
Eclipse IDE for Java Developers 4.4.2.20150219-0708 epp.package.java null
IBM Dojo Mobile Tools 7.1.0.00-20160321-2138
IBM jQuery Mobile Tools 7.1.0.00-20160321-2138
IBM MobileFirst Platform Studio 7.1.0.00-20160321-2138
IBM MobileFirst Platform Test Workbench 8.7.0.v20160112_2203
Tracer for OpenGL ES 23.0.7.2120684