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

feat: Add mobile command to type Unicode text #365

Merged
merged 1 commit into from
Feb 22, 2020

Conversation

mykola-mokhnach
Copy link
Contributor

No description provided.

Copy link
Member

@jlipps jlipps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this differ from sendkeys?

Copy link
Member

@KazuCocoa KazuCocoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this set unicode text into the focused field, not like setValue? (The setValue with unicode keyboard capability is kindly relace the field)

@mykola-mokhnach
Copy link
Contributor Author

mykola-mokhnach commented Feb 22, 2020

@jlipps The main difference is that sendKeys always overrides the existing field text. For example, if one needs to enter st into an input field containing te then it would be necessary to remember the current content, prefix the given content with it and only after that call setText (native UIA API used by sendKeys call). This is not acceptable for cases where Android app under test reacts to each key press (we only expect to get notified with st, but it would be test instead).

There is also key actions W3C API, but it only supports ASCII chars and fails for Unicode (see the issue appium/appium#13154).

So, the only way to achieve the desired input scenario would be the current endpoint.

@mykola-mokhnach
Copy link
Contributor Author

mykola-mokhnach commented Feb 22, 2020

@KazuCocoa Yes, I did it deliberately, because this endpoint does not care about the actual focus. It just triggers the appropriate key codes and sends them to the system thus emulating actual user interactions.

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

Successfully merging this pull request may close these issues.

None yet

3 participants