0
votes

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.

Here where it goes offscript. enter image description here

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)

The error screen

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
1
Try with Android 4.x, does it work there?Idan Adar
Re-recorded the four steps on a Samsung Galaxy SIII mini with Android 4.1.2 and it worked perfectly. I even added a couple of verifications on the buttons.Andrei

1 Answers

0
votes

See here: Uploading hybrid app to mobilefirst test workbench fails

it is a known problem that appeared with latest build-tools versions

to make short, RTW uses "dex2jar" and other utility tools, that rely on android sdk. if sdk evolve (new build-tools for example), these tools have to be also ugraded (they are embedded in RTW)

Best would be to upgrade RTW to latest version to be able to support your sdk version (contact IBM support for that. RTW 8702 is available and 871 should be live around mid october 2015)

a workaround would be to to downgrade your "build-tools" in android sdk manager to an older version