葫芦处理和QUOT;完成动作用"对话 [英] Calabash handling "Complete action using" dialog

查看:227
本文介绍了葫芦处理和QUOT;完成动作用"对话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想测试一个应用程序共享功能,但我不知道如何处理的android对话框中的使用完整的行动(脸谱,Gmail会等)
当我使用查询(*)它返回一个空的字段集。
有没有办法用葫芦或测试等功能共享任何其他方式来处理这样的系统对话框?

I want to test sharing functionality of an app but I have no idea how to handle android dialog "Complete action using" (Facebook, Gmail etc.)
When I use query("*") it is returning an empty set of fields.
Is there any way to handle such system dialogs using Calabash or any other way to test such functionality as sharing?

我在物理设备上运行我的测试。

I am running my tests on physical device.

编辑:?如果没有办法检查是否已经打开与否的对话,那么也许就可以使用亚行外壳或类似的东西。

If there is no way to check whether the dialog has been opened or not, then maybe it is possible using adb shell or something like that?

推荐答案

这不是一个很优雅的解决方案,但你可以使用亚行模拟屏幕触摸。还有的是,这里涵盖了它的答案 - <一个href="http://stackoverflow.com/questions/8647826/simulating-touch-using-adb/8647953#8647953">simulating触摸使用亚行

It's not a very elegant solution but you can simulate screen touches using adb. There is an answer that covers it here - simulating touch using ADB

编辑:添加一些细节上利用亚行转储所有的UI元素的文件

Adding some details on using adb to dump a file of all of the UI elements.

在在平台/ Android的-L文件夹中的Andr​​oid SDK中有一个叫做uiautomater.jar亚行工具可以用于运行测试(虽然我从来没有使用过的那个),并转储可见的xml文件元素。

In the android sdk in the platforms/android-L folder there is a tool called uiautomater.jar that adb can use to run tests (though I've never used it for that) and to dump an xml file of the visible elements.

亚行外壳uiautomator转储的test.xml

将创建XML文件,你可以再看看通过你的code,以检查你想要的弹出(该设备没有在您的计算机上)。如果你想使用弹出交互,那么你可以使用在XML转储来接你要哪一个,并使用亚行的触摸事件中给出的坐标,点击它。

will create the xml file (on the device not your computer) that you could then look through in your code to check for the pop up you want. If you want to interact with the pop up then you can use the coordinates given in the xml dump to pick which one you want and use an adb touch event to click it.

不是pretty的解决方案,但希望不要太困难的工作到你的测试:)

Not a pretty solution but hopefully not too difficult to work into your tests :)

这篇关于葫芦处理和QUOT;完成动作用&QUOT;对话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆