3

I am trying to write UI tests using Espresso for an APK but I don't have the source code. I am trying to init the ActivityTestRule using classpath.

I followed this article

  private static final String CLASSNAME = "com.mytaxi.android_demo.activities.AuthenticationActivity";
  private static Class<? extends Activity>  activityClass = (Class<? extends Activity>) Class.forName(CLASSNAME);
  @Rule
  public ActivityTestRule<?> mActivityRule = newActivityTestRule(CLASSNAME);

but I caught this exception "java.lang.RuntimeException: No activities found"

1 Answer 1

1

Chances are, this APK is proguard protected. So the classes/packages names are currently obfuscated. In another words, the names are currently different.

Try using Monkey Runner instead

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.