Auth0.Android icon indicating copy to clipboard operation
Auth0.Android copied to clipboard

Android automation blocked by lack of Login Automation documentation

Open fmatosqg opened this issue 2 months ago • 3 comments

Checklist

  • [x] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • [x] I have looked into the API documentation and have not found a suitable solution or answer.
  • [x] I have searched the issues and have not found a suitable solution or answer.
  • [x] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • [x] I agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

My problem is exactly the same as https://github.com/auth0/Auth0.Android/issues/636, however the solution there points to a file from the flutter repo that doesn't exist anymore. I will assume that that file was outdated and/or didn't do its job anymore.

I've tried UIAutomator to no success. It's extremely flaky. Some of the problems I'm facing are:

  • hard to determine when the webview finished loading, and using waitForStableInActiveWindow is challenging because of the blinking cursor
  • easy to fill in the field on emulator without google apis but couldn't find a way on google emulator with gplay, since it wipes the viewIdResourceName and all I have left is a non-editable label with a sibling which is an EditText
  • when clicking the login button it's extremely flaky, since very often the keyboard obscures it partially making the code think it clicked when it didn't ; creating a watcher to dismiss keyboard is also very flaky for reasons I can't understand

and half a dozen other variations, as soon as I stabilize one thing I find another one that's super unstable.

Describe the ideal solution

1- Is it possible to de-activate web login and do it through either native ui or headless? The only url that is exposed to CI is the one that the webview uses.

or

2- Can you please provide an alternative method of logging in? I'm happy to do manual regression for testing login as a feature, what I need is a way to reach the logged in state so I can do instrumented tests for features that are unrelated to login but still require a valid token - meaning I need to achieve the "logged in" state by any method

or

3- Can you share the old file even if it's not 100% helpful?

or

4- Can you find and publish an official solution to this problem?

Alternatives and current workarounds

No response

Additional context

No response

fmatosqg avatar Nov 11 '25 01:11 fmatosqg

Hi @fmatosqg , You can perform native login using our embedded APIs using email and password https://github.com/auth0/Auth0.Android/blob/5e93b424cc3d6fe0d474fb498428b65fda944ccb/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt#L98

pmathew92 avatar Nov 12 '25 03:11 pmathew92

Hi @fmatosqg , Just checking in if you were able to use our embedded APIs and if it resolved your issue ?

pmathew92 avatar Dec 12 '25 05:12 pmathew92

I found a workaround.

But you definitely should provide an official way to allow e2e automation to corporations who insist on using Chrome tabs because of cyber security. Which means, every big player, mine included.

Oauth is free but Auth0 is not. It should come with the official documentation. This is not a favour....

At least put easy automation markers in your divs, that would help. My freaking emulator browser with chromium is easy to log in, then I go to Samsung with Chrome and the things are in a different place in a different way. Web team says code is a black box and nothing they can control....

On Fri, 12 Dec 2025, 17:00 Prince Mathew, @.***> wrote:

pmathew92 left a comment (auth0/Auth0.Android#876) https://github.com/auth0/Auth0.Android/issues/876#issuecomment-3645041382

Hi @fmatosqg https://github.com/fmatosqg , Just checking in if you were able to use our embedded APIs and if it resolved your issue ?

— Reply to this email directly, view it on GitHub https://github.com/auth0/Auth0.Android/issues/876#issuecomment-3645041382, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABI4Y4IQUFGR5Y6L3N2QRVD4BJKXDAVCNFSM6AAAAACLXAOTO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMNBVGA2DCMZYGI . You are receiving this because you were mentioned.Message ID: <auth0/Auth0 .@.***>

Fabio de Matos Android Developer email: @.** medium: @.*** *linkedin: *www.linkedin.com/in/fabio-de-matos

fmatosqg avatar Dec 12 '25 08:12 fmatosqg