Search code examples
androidcalabashcalabash-android

Enter username and password into Dropbox login webview with Calablash android


I'm creating a test that is expected to login in dropbox. So the app starts the dropbox login webview. With query("webView css:'input'") I'm able to retrieve the two inputs: login and password.

When I try to set the email field with enter_text(query("webView css:'input'").first,"[email protected]") I get the error:

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

Any idea how to resolve this? Thanks!


Solution

  • I've managed to set the text, it works but I can't understand what is the difference with the question's command. The solution is: enter_text("webView css:'input[name=login_email]'", "[email protected]")

    Probably enter_text and query don't get along