我有一个项目设置用Cucumber和Appium测试一个android apk文件。
该项目使用标准support / env.rb,它从appium.txt文件中提取以进行测试设置。这是基于appium github page
上的appium示例代码当我运行arc
命令时,它会将我转储到调试会话中。从那里我运行page
从驱动程序转储源。在gem中,在appium_lib/android/helper.rb中调用@ driver.page_source
所以驱动程序是一样的,并且它在驱动程序上调用相同的方法,但输出是不同的
android.widget.Button (0)
text: Agree
strings.xml: login_agree
android.widget.Button (1)
text: Disagree [Quit]
strings.xml: login_disagree
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").click
和id("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特有的。