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

robotium typetext wrong order #876

Open
Mrxiaoxie opened this issue Sep 26, 2017 · 2 comments
Open

robotium typetext wrong order #876

Mrxiaoxie opened this issue Sep 26, 2017 · 2 comments

Comments

@Mrxiaoxie
Copy link

When I use typetext() to verify edittext limit conditions , I found that the order of text is wrong.
my code:
Edite text = solo.getEditText(0); solo.setText(text,""); solo.typeText(text,'2.2222'); assertEquals("2.22", text.getText().toString());

but I get actual result is 22.22 not 2.22
how can I avoid this situation?
thank you in advance!

@andrewleo
Copy link

This happened to me long time ago.
setText maybe more reliable because it uses Android API to input text , while typeText use Instrumentation sendStringSync, it emulates soft keyboard to enter text.

@Mrxiaoxie
Copy link
Author

Thank you!
But If I use solo.setEditText(text,'2.2222'), the result of text.getText().toString() is empty.
I want to simulate the actions of users,but this problem bother me a lot.

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

No branches or pull requests

2 participants