I am unable to perform my android espresso unit test and it has failed with:
// (kotlin syntax)
closeSoftKeyboard()
onView(withId(R.id.et_login_mobile_number)).perform(TypeTextAction(invalidMobileNo))
closeSoftKeyboard()
androidx.test.espresso.InjectEventSecurityException: java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission.
I finally learned that: ANY UNEXPECTED animation appeared on UI that is undergoing automated testing could interrupt the process.
So I suspect this is due to the Google Password Manager that suggesting the list of saved password keep popping up and it might be the one causing the interruption.
What I'm looking now is: THE WAY OF TURNING OFF GOOGLE PASSWORD MANAGER FROM SUGGESTING SAVED PASSWORD
All I keep found is
Manage offers to save passwords
And there is no way to turn it off / disable it
After I ended up delete all the saved passwords from Google Password Manager and now it turned up suggest autofill text (Kindly compare both screenshot)
I have included attributes as followed, it still DOES NOT PREVENT autofill to device with Android 8 and above.
android:inputType="number|textNoSuggestions|textFilter"
According to this Answer ,
android:importantForAutofill="no"
works to prevent both default autofill and Google Password Manager from Android 8 and above.
I think you should try deleting the current saved passwords and adding this app in declined apps' list. This was the app will not have any options to autofill and the pop-up will not show.
Let me know if this helps. Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With