0

I have an app with three interactive UI elements, two edittext's and one button. I'm running calabash android 0.4.20 (since 0.4.21 seems broken)

If I enter console and run:

$ query "button"

It shows me just a single result.

If I click into the second edittext to set focus there, and then run:

$ touch "button"

The focus is set to the top edittext and the button does not receive a click event.

Any clues why?

I saw some notes here and there that calabash sometimes miscalculates the locations of the UI element when keyboard is present. I'm not sure where it it sending the touch event, perhaps the x/y coordinates are wrong?

This fails too:

$ performAction 'press', 'login' # login is the ID of the button...

How can I troubleshoot this?

xrd
  • 3,841
  • 5
  • 24
  • 32

3 Answers3

0

does your button have an id?

query("Button id:'button_id'")

touch("Button id:'button_id'")

there are more details in calabash doc on how to write a query statement...

Dave
  • 11
  • 2
  • The button definitely has id:'login'. Even if I manually specify it in my query, the click fails. – xrd Apr 03 '14 at 23:34
0

In your console try this,

start_test_server_in_background (This should launch your app specified in the console)

Then try the following login_btn = query("* id:'login'") touch(login_btn)

This should definitely touch the login button on the screen. If it does not, then the id is not 'login'

Bharat Gatty
  • 31
  • 1
  • 5
0

Just from the description it sounds like the keyboard is obscuring the button. You might want to check out this post: Close/hide the Android Soft Keyboard which has some tricks for hiding the keyboard.

Another issue I sometimes have is with more than one input being returned in an array. Sometimes you need to specify the array result you want to click on otherwise it will click the first item in the array.

Community
  • 1
  • 1
Joe Susnick
  • 5,298
  • 4
  • 35
  • 47