当使用相同的Appium驱动程序时,为什么Genymotion和AVD之间的输出会有所不同?

时间:2015-03-11 19:45:18

标签: android avd appium genymotion saucelabs

我有一个项目设置用Cucumber和Appium测试一个android apk文件。

该项目使用标准support / env.rb,它从appium.txt文件中提取以进行测试设置。这是基于appium github page

上的appium示例代码

当我运行arc命令时,它会将我转储到调试会话中。从那里我运行page从驱动程序转储源。在gem中,在appium_lib/android/helper.rb中调用@ driver.page_source

所以驱动程序是一样的,并且它在驱动程序上调用相同的方法,但输出是不同的

在Genymotion上输出如下:

android.widget.Button (0)
  text: Agree
  strings.xml: login_agree

android.widget.Button (1)
  text: Disagree [Quit]
  strings.xml: login_disagree

在AVD上,输出如下:

android.widget.Button (0)
  text: Agree
  id: com.xxxxx.xxxxx:id/agree_btn
  strings.xml: login_agree

android.widget.Button (1)
  text: Disagree [Quit]
  id: com.xxxxx.xxxx:id/disagree_btn
  strings.xml: login_disagree

因此button("Agree").clickid("agree_btn").click适用于AVD但不适用于Genymotion。

button(1).click这样的东西都适用于它们。

任何人都知道为什么这是/如何修复它以便Genymotion输出更详细?

更新

切换到使用API​​ 19的Genymotion设备似乎解决了这个问题。之前的设备已设置为API 17.仍然不确定为什么这会在这里产生影响。

当我使用带有API 17的avd设备时,输出为:

android.widget.Button (0)
  text: Agree
  strings.xml: login_agree

android.widget.Button (1)
  text: Disagree [Quit]
  strings.xml: login_disagree

问题似乎不是Genymotion特有的。

0 个答案:

没有答案