Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uia_type_string enters loop when trying to type a key that does not exist on the keyboard - UITextFields only #310

Closed
jmoody opened this issue Feb 8, 2014 · 5 comments · Fixed by calabash/run_loop#82
Assignees
Labels

Comments

@jmoody
Copy link
Contributor

jmoody commented Feb 8, 2014

  • calabash-ios 0.9.166

possible related to #269

seen on:

  • iPhone 5C iOS 7.0.2
  • iPhone 4S iOS 6.1.3
  • iPhone Simulator iOS 7

example:

OT%.I&k&~[@1p4`wGw$UF^Q{_!+_!E6{DkFz_ON@^E.@.1{eA@ - 'VerboseError: Unable to type: 
OT%.I&k&~[@1p4`wGw$UF^Q{_!+_!E6{DkFz_ON@^E.@.1{eA@
reproduce
# might need to run this a few times
$ be cucumber -p launch -t @issue_310

not reproducible on the console

10.times { 
    clear_text("textField marked:'top tf'")
    sleep(0.4)
     keyboard_enter_text 'OT%.I&k&~[@1p4`wGw$UF^Q{_!+_!E6{DkFz_ON@^E.@.1{eA@'; sleep(0.4) 
}

seems to occur more often when the device is rotated

100.times { 
    3.times { rotate_home_button_to ['top', 'bottom', 'left', 'right'].sample }
    puts "status bar orientation => '#{status_bar_orientation}'"
    wait_for_view 'top tf'
    clear_text("textField marked:'top tf'")
    sleep(0.2)
    keyboard_enter_text 'OT%.I&k&~[@1p4`wGw$UF^Q{_!+_!E6{DkFz_ON@^E.@.1{eA@'
    sleep(0.2)
}
@Goginenni
Copy link

I am having the same issue on iOS 7.0.3 simulator and continuously reproducible . I am using Xcode 5.0.2, calabash 0.9.166

@jmoody
Copy link
Contributor Author

jmoody commented Feb 17, 2014

@Goginenni thanks for confirming. we are trying to sort out what the problem is.

@jmoody
Copy link
Contributor Author

jmoody commented Feb 22, 2014

@Goginenni

Please have a look at your string and check the keyboard you are using for input. Does that keyboard have all the keys necessary to type the string?

For example, the default keyboard does not have the backtick ( ` ) character, but the email keyboard does.

@jmoody
Copy link
Contributor Author

jmoody commented Feb 22, 2014

ATTN: @krukow

Xcode 5.0.2
$ calabash-ios version => 0.9.168.pre2
> server_version['version'] => 0.9.168.pre2

Here is a video demonstrating the behavior.

https://s3-eu-west-1.amazonaws.com/littlejoysoftware-eu/public/2014-02-22_03-48-57.mp4

Reproduced in briar-ios-example master

$ be cucumber -p launch -t @issue_310

reproduce
  1. launch an app in iOS7
  2. touch a text field to show a keyboard
  3. look for a key that does not exist - say the backquote (`)
    • default keyboard does not have backquote => `
    • email keyboard does not have parens => ( )
  4. try typing text with that missing key
    `

    keyboard_enter_text "this key is missing"

expected
"could not type 'str with ` backquote' - 'VerboseError: target.frontMostApp().keyboard() failed to locate key '`''"
found

calabash tries to type the text many (5+) times before failing with this very confusing exception:

'could not type 'this ` key is missing' - 'VerboseError: Unable to type: this ` key is missing' (RuntimeError)
regression

since 0.9.165 - uia_key_board optimizations

notes

This only happens on UITextFields - which is consistent with my understanding of the 0.9.165 fix

Expected Behavior

If a key cannot be found, uia_type_string should raise an exception.

It should not, however, try to re-type the string over and over before failing.

This also cause the ScriptAgent process to hang and/or crash.

@krukow
Copy link
Contributor

krukow commented Nov 29, 2014

Should be fixed in 0.11.5.pre3 - #630

Please reopen if you see fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants