Search code examples
javascriptandroidautomationautomated-testsmonkeytalk

MonkeyTalk on Android and WebChromeClient/onJsScript conflict


I have configured "Monkey Talk" to work with my android app. Everything works except for the Activity which uses a Webview with a custom WebChromeClient, which utilizes the onJsScript(...) method of WebChromeClient. Basically, the call back never occurs and instead a dialog prompt pops up in the application. This looks similar to the problem people reported with phonegap. Does "Monkey Talk" set its own WebChromeClient, which could conflict with the one I use? Anyone run into similar problems have any solutions? (The phonegap solution of installing the latest version of cordova.jar is not something helpful to me since I use neither phonegap or cordova)

If no one has fix for this problem please suggest another free test-automation tools that allows for simple test script creation (e.g. recording). Thanks.


Solution

  • Found a bug in the Monkey Talk code (current version, which is 1.0.53) that causes this problem.

    In MonkeyTalk's WebCrhomeClientWrapper in the override of onJsPrompt, client.onJsConfirm is called instead of client.onJsPrompt:

    @Override
    public boolean onJsPrompt(WebView view, String url, String message, String defaultValue,
                              final JsPromptResult result) {
        if (client.onJsConfirm(view, url, message, result)) { ...
    

    Sent the info to the Monkey Talk team, hopefully they'll fix this soon.