应用程序中的 Android Web 自动化

标签 android selenium web-testing

我想制作一个简单的 android 应用程序,可以在网络上执行一些自动化行为。

我希望能够输入用户名/密码详细信息,并让我的应用程序大概通过 WebView 导航到网站,并填写我的登录凭据并导航到网站的特定部分。

我意识到 selenium 非常适合这样的任务,但我想知道是否有人有过尝试类似事情的经验,以及是否可以从 Android 应用程序内部而不是像我意识到的那样在独立服务器上运行来测试实际应用程序是 selenium/selenedroids 的主要目的。

谢谢

最佳答案

如果您的目的是通过 Android 应用自动执行网络测试操作,请尝试 calabash-android ,就像 Android 的 Selenium。

Calabash-android 支持 WebView 操作,在您的情况下也支持输入文本。

You can use the enter_text method to enter text in a webview (in addition to any other android widget).

enter_text("webView css:'input.login'", "run")

This will enter the text "run" into the first input field of the class 'login'.

来源:https://github.com/calabash/calabash-android/wiki/06-webview-support

关于应用程序中的 Android Web 自动化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28755104/

相关文章:

ruby - watir splash 中的页面对象——如何确保正确的页面对象被实例化

Android:写入非 Activity 类中的文件

android - 在 Android 应用程序中启用或禁用 App 的权限

android - Canvas 局部放大

python - 从 Selenium IDE 到 Python - 没有这样的元素

html - 如何在 Selenium WebDriver 中找到 HTML 子标签的索引?

具有自定义 View 的 Android AlertDialog : get input data

selenium - 如何在 Selenium WebDriver 中使用文本获取标签的索引/位置?

testing - Web应用程序UI一致性的自动化测试

testing - 关于 .testcaferc.json 应该存放在哪里的困惑