Open gdobra opened 10 years ago
Good point
Of course, it's worth escaping the %s whenever that's exactly what the user wants to type in, in order not to be replaced by a space in the input text. So a review of adb's escape sequences would help do the job correctly.
Sorry, I didn't quite understand you last comment. Do you have some examples?
On Wed, Nov 27, 2013 at 5:21 AM, gdobra notifications@github.com wrote:
Of course, it's worth escaping the %s whenever that's exactly what the user wants to type in, in order not to be replaced by a space in the input text. So a review of adb's escape sequences would help do the job correctly.
— Reply to this email directly or view it on GitHubhttps://github.com/dtmilano/AndroidViewClient/issues/72#issuecomment-29373624 .
Have you read my blog ? http://dtmilano.blogspot.com android junit tests ui linux cult thin clients
well, if I really want to input "%s" that should be escaped as "\%s" or something. So, if my text is "this is %s", that should be modified as "this%sis%s\%s"
view.type() is too slow just because it types every single character using a different 'adb shell input text' on each character contained in str. And that's done this way because adb input text won't accept space. So, instead of calling adb for each and every character, you could replace " " with "%s" and do the input in one go.
instead of: for c in str: device.type(c)
we could write: str = str.replace(" ", "%s") device.type(str)