Note that there are some explanatory texts on larger screens.

plurals
  1. POMy app is crashing after installing the MonkeyTalk agent
    primarykey
    data
    text
    <p>I'm trying to use the <a href="https://www.gorillalogic.com/monkeytalk" rel="nofollow">MonkeyTalk</a> to automate the black-box tests in my Android app. The problem I'm facing is that they don't have anything documented about using it with Maven. So, after a lot of research and trying a lot of things, I made the build to work. But, my app is crashing when I install the MonkeyTalk agent.</p> <p>I don't know if it's something wrong with my build or if the MonkeyTalk agent is incompatible with the libraries I'm using. So, here is what I've done to build with maven:</p> <p>First, I've downloaded the MonkeyTalk and installed the JAR of the agent using this command:</p> <pre><code>mvn install:install-file -Dfile=monkeytalk-agent-1.0.53.jar -DgroupId="com.gorillalogic.monkeytalk" -DartifactId="monkeytalk-agent" -Dversion="1.0.53" -Dpackaging="jar" </code></pre> <p>So, I added the following dependencies:</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;org.aspectj&lt;/groupId&gt; &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt; &lt;version&gt;1.6.2&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.aspectj&lt;/groupId&gt; &lt;artifactId&gt;aspectjtools&lt;/artifactId&gt; &lt;version&gt;1.6.2&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; </code></pre> <p>And, since I don't want the MonkeyTalk agent to be included in every release, I've created a profile as follows:</p> <pre><code>&lt;profile&gt; &lt;id&gt;monkeytalk&lt;/id&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;com.gorillalogic.monkeytalk&lt;/groupId&gt; &lt;artifactId&gt;monkeytalk-agent&lt;/artifactId&gt; &lt;version&gt;1.0.53&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;aspectj-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.4&lt;/version&gt; &lt;configuration&gt; &lt;source&gt;1.6&lt;/source&gt; &lt;target&gt;1.6&lt;/target&gt; &lt;aspectLibraries&gt; &lt;aspectLibrary&gt; &lt;groupId&gt;com.gorillalogic.monkeytalk&lt;/groupId&gt; &lt;artifactId&gt;monkeytalk-agent&lt;/artifactId&gt; &lt;/aspectLibrary&gt; &lt;/aspectLibraries&gt; &lt;showWeaveInfo&gt;true&lt;/showWeaveInfo&gt; &lt;verbose&gt;true&lt;/verbose&gt; &lt;Xlint&gt;ignore&lt;/Xlint&gt; &lt;outxml&gt;true&lt;/outxml&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;!--&lt;phase&gt;process-sources&lt;/phase&gt;--&gt; &lt;goals&gt; &lt;goal&gt;compile&lt;/goal&gt; &lt;goal&gt;test-compile&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/profile&gt; </code></pre> <p>With this configuration, the build works normally. I see in the log that the aspectj plugin is configuring the MonkeyTalk. Here is part of the log:</p> <pre><code>[INFO] Join point 'method-call(void android.widget.TextView.setText(java.lang.CharSequence))' in Type 'com.devspark.appmsg.AppMsg' (AppMsg.java:144) advised by before advice from 'com.gorillalogic.fonemonkey.aspects.SetText' (monkeytalk-agent-1.0.56.jar!SetText.class:26(from SetText.aj)) [INFO] Join point 'method-call(void com.devspark.appmsg.AppMsg.setText(java.lang.CharSequence))' in Type 'com.devspark.appmsg.AppMsg' (AppMsg.java:286) advised by before advice from 'com.gorillalogic.fonemonkey.aspects.SetText' (monkeytalk-agent-1.0.56.jar!SetText.class:26(from SetText.aj)) [INFO] Join point 'method-call(void android.widget.TextView.setText(java.lang.CharSequence))' in Type 'com.devspark.appmsg.AppMsg' (AppMsg.java:302) advised by before advice from 'com.gorillalogic.fonemonkey.aspects.SetText' (monkeytalk-agent-1.0.56.jar!SetText.class:26(from SetText.aj)) </code></pre> <p>Ok, but when I install the app and try to open it, I can only open the first screen, that is the most simple, having just some buttons that either login via a social network or open another Activity. But when I open another Activity, that is much more complex, the app crashes. And it's very strange, because in each Android version, it crashes with a different exception.</p> <p>This exception, for example, happens with Android 4.3:</p> <pre><code>08-22 16:49:54.012: INFO/ActivityManager(534): START u0 {cmp=com.soongz/.ui.CadastroActivity} from pid 17633 08-22 16:49:54.803: ERROR/AndroidRuntime(17633): FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.soongz/com.soongz.ui.CadastroActivity}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) at android.app.ActivityThread.access$600(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method) Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:226) at android.app.Activity.requestWindowFeature(Activity.java:3264) at android.support.v7.app.ActionBarActivityDelegateICS.supportRequestWindowFeature(ActionBarActivityDelegateICS.java:126) at android.support.v7.app.ActionBarActivity.supportRequestWindowFeature(ActionBarActivity.java:150) at com.soongz.ui.BaseActionBarActivity.createView(BaseActionBarActivity.java:72) at com.soongz.ui.CadastroActivity.createView(CadastroActivity.java:110) at br.com.cybereagle.androidlibrary.ui.helper.RetainedActivityHelper.onCreate(RetainedActivityHelper.java:42) at br.com.cybereagle.androidlibrary.ui.RetainedRoboActionBarActivity.onCreate(RetainedRoboActionBarActivity.java:45) at android.app.Activity.performCreate(Activity.java:5133) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) ... 11 more 08-22 16:49:54.813: WARN/ActivityManager(534): Force finishing activity com.soongz/.ui.CadastroActivity 08-22 16:49:54.813: WARN/ActivityManager(534): Force finishing activity com.soongz/.ui.MainActivity </code></pre> <p>In Android 2.2, I have this exception:</p> <pre><code>08-22 17:32:32.503: ERROR/AndroidRuntime(698): FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.gorillalogic.fonemonkey.automators.AutomationManager at com.gorillalogic.fonemonkey.aspects.SetListener.ajc$after$com_gorillalogic_fonemonkey_aspects_SetListener$1$bfeaeda5(SetListener.aj:30) at com.soongz.service.autenticacao.AbstractAutenticador.&lt;init&gt;(AbstractAutenticador.java:51) at com.soongz.service.autenticacao.AutenticadorFacebook.&lt;init&gt;(AutenticadorFacebook.java:38) at com.soongz.ui.MainActivity.initializeUnretainedInstanceFields(MainActivity.java:54) at br.com.cybereagle.androidlibrary.ui.helper.RetainedActivityHelper.onCreate(RetainedActivityHelper.java:34) at br.com.cybereagle.androidlibrary.ui.RetainedRoboFragmentActivity.onCreate(RetainedRoboFragmentActivity.java:36) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) at android.app.ActivityThread.access$2300(ActivityThread.java:125) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4627) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>Does someone with more experience with MonkeyTalk knows why its agent is breaking my app? Is it my maven configuration?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload