输入用户名和密码到Dropbox用Calablash登录webview android

输入用户名和密码到Dropbox用Calablash登录webview android

问题描述:

我正在创建一个测试,希望在Dropbox中登录。因此,该应用程序启动Dropbox登录webview。 与query("webView css:'input'")我可以检索两个输入:登录名和密码。输入用户名和密码到Dropbox用Calablash登录webview android

当我尝试设置电子邮件字段enter_text(query("webView css:'input'").first,"[email protected]")我得到的错误:

RuntimeError: map {"class"=>"text-input-input autofocus", "nodeType"=>"ELEMENT_NODE", "id"=>"pyxl14", "calSavedIndex"=>5, "html"=>"<input class=\"text-input-input autofocus\" type=\"email\" name=\"login_email\" id=\"pyxl14\">", "textContent"=>"", "rect"=>{"y"=>640, "x"=>52, "center_x"=>540, "height"=>89, "width"=>976, "top"=>220, "left"=>20, "center_y"=>685}, "nodeName"=>"INPUT", "webView"=>"NoResourceEntry-6"}, query failed because: java.util.LinkedHashMap cannot be cast to java.lang.String

不知道如何解决这个问题?谢谢!

+0

有你检查它是不是cordovaWebView?在葫芦控制台中运行'query“*”'并尝试在输出中找到根webview元素类型。 –

+0

@RogérioPeixoto其实我都有。 Dropbox一个是WebView。无论如何,我能够获得输入字段,所以这不是问题,问题是我无法设置文本。 – gderaco

我已经设置了文本,它的工作原理,但我不明白与问题的命令有什么不同。 解决的办法是:enter_text("webView css:'input[name=login_email]'", "[email protected]")

大概enter_textquery沿

没有得到我会建议您尝试使用XPath限制查询过滤器在enter_text函数的第一个参数:

enter_text("webView xpath:'//input[@id=\"pyxl14\"]'", "[email protected]")