我想制作一个简单的 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/