简体   繁体   English

使用Monkeytalk测试Android应用程序,“记录”按钮已禁用

[英]Using monkeytalk to test android app, the record button is disabled

We are using eclipse luna 4.4.1, adb is installed on linux system to test android app. 我们使用的是eclipse luna 4.4.1,在Linux系统上安装了adb来测试android应用。 I followed below steps: 我遵循以下步骤:

  1. Import an android project in eclipse 在eclipse中导入android项目
  2. Created libs folder in the android project and copied monkey talk agent into the libs folder(monkeytalk-agent-2.1.10.jar) 在android项目中创建了libs文件夹,并将Monkey Talk Agent复制到了libs文件夹(monkeytalk-agent-2.1.10.jar)
  3. Right click on project and configured to Configur -> Convert to AspectJ Project 右键单击项目并配置为Configur-> Convert to AspectJ Project
  4. Right click on project and select AspectJ Tools -> Add to AspectJpath 右键单击项目,然后选择AspectJ Tools->添加到AspectJpath
  5. Opened the AndroidManifest.xml and copied the below two lines in that xml file to give permission 打开AndroidManifest.xml并在该xml文件中复制以下两行以授予权限
  6. Right click on the android project and navigated to project properties-> Java Build Path-> Order and Export tab -> checked AspectJ Runtime Library. 右键单击android项目,然后导航到项目属性-> Java Build Path-> Order and Export选项卡->已选中AspectJ Runtime Library。
  7. Right Click on project ->Run ->Android application. 右键单击项目->运行-> Android应用程序。
  8. After that I created a sample project in MonkeyTalkIDEProfessional 之后,我在MonkeyTalkIDEProfessional中创建了一个示例项目
  9. And then I created a sample test script in the project(Right click on project and navigated to New -> Script). 然后,我在项目中创建了一个示例测试脚本(右键单击项目并导航至“新建”->“脚本”)。
  10. Clicked on android connection icon and selected the option(Android Emulator) option. 单击android连接图标,然后选择选项(Android Emulator)选项。 In this case RECORD BUTTON of MonkeyTalkIDEProfessional is DISABLED. 在这种情况下,MonkeyTalkIDEProfessional的RECORD BUTTON被禁用。

This can be caused by several issues: 这可能是由几个问题引起的:

  • Port forwarding between your host maschine and emulator is not configured ( read more on that). 未配置主机与仿真器之间的端口转发(有关更多信息)。 Run following command in order to fix that: 运行以下命令以解决此问题:

    adb forward tcp:[PORT_NUMBER_IN_USE] tcp:[PORT_NUMBER_IN_USE]

  • The path to Android SDK in MonkeyTalk preferences is not set up correctly. MonkeyTalk首选项中的Android SDK路径未正确设置。 You have to first install Android SDK and then specify path to it in MonkeyTalk. 您必须先安装Android SDK ,然后在MonkeyTalk中指定其路径。 You should probably also check “Include Android Testing?” checkbox. 您可能还应该选中“包括Android测试?”复选框。

This tutorial for setting up Android agent in MonkeyTalk can also be useful to you. 在MonkeyTalk中设置Android代理的本教程对您也很有用。

while creating the MonkeyTalk project, it ask you for the instrumented APK. 在创建MonkeyTalk项目时,它会要求您提供经过检测的APK。 If it is accepting the APK means it is perfectly instrumented. 如果它接受APK,则表示它已被很好地检测。 Once it is done, make sure your phone connected to the system, better do 完成后,请确保您的手机已连接至系统,最好做

adb devices adb设备

If it is perfectly connected, your device should be visible in connect tab of MonekyTalk, select it, then open your Instrumented App on the phone, then the record button automatically appear in the MonkeyTalk. 如果连接正确,则应该在MonekyTalk的“连接”选项卡中看到您的设备,选择它,然后在电话上打开您的Instrumented App,然后“记录”按钮自动出现在MonkeyTalk中。 My suggestion is instead of using Emulator better to use Android device. 我的建议是最好不要使用仿真器来使用Android设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM