0
votes

I created a simple dojomobile app in worklight 6.1. I have the mobile test workbench installed in the same eclipse env as worklight. The code below is the dojo code for the hybrid app's index.html. It is a very basic dojo mobile app using default header information from worklight.

<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="UTF-8">
        <title>index</title>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <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 type="text/javascript" src="dojox/mobile/deviceTheme.js"></script>
        <script type="text/javascript" data-dojo-config="isDebug: false, async: true, parseOnLoad: true, mblHideAddressBar: false" src="dojo/dojo.js"></script>
    </head>
    <body style="display: none;">
        <div data-dojo-type="dojox.mobile.View" id="view0" data-dojo-props="selected:true">
            <div data-dojo-type="dojox.mobile.Heading" data-dojo-props="label:'Heading'"></div>
            <h2 data-dojo-type="dojox.mobile.RoundRectCategory">Category</h2>
            <div data-dojo-type="dojox.mobile.RoundRect">
                <div data-dojo-type="dojox.mobile.RoundRectList">
                    <div data-dojo-type="dojox.mobile.ListItem" data-dojo-props="label:'Item'"></div>
                    <div data-dojo-type="dojox.mobile.ListItem" data-dojo-props="label:'Item'"></div>
                </div>
            </div>
            <button data-dojo-type="dojox.mobile.Button">Button1</button>
            <button data-dojo-type="dojox.mobile.Button">Button2</button>
            <button data-dojo-type="dojox.mobile.Button">Button3</button>
        </div>
        <script src="js/initOptions.js"></script>
        <script src="js/main.js"></script>
        <script src="js/messages.js"></script>
    </body>
</html>

The problem when I register the app in the test workbench and record a test on my android device (Samsung s4). The test app does not recognize it is running dojo. The display of the app on the device is missing the header line. The test contents from from the recorded steps say that I clicked on JQuery Button and not dojox.mobile.Button.

Weird thing, when you go to replay the recorded test, the app displays properly (header and other dojo controls), and the script fails because it is looking for JQuery Button. I could go in and edit the script so that it is correct, but that is not what I want to do for every script that I record or rerecord because of app changes.

Please let me know what I'm doing wrong or is this a known problem.

1

1 Answers

0
votes

Jquery is added by default into the worklight application. See the script tag with

<script>window.$ = window.jQuery = WLJQ;</script>

in your Html head tag. Remove it and try!