I am performing a sign in operation on the Android application using appium test scripts. The test scripts doesn't execute the lines of code related to the new activity.

It works on debug mode or if I perform an operation manually on the simulator.

I am using selenium 3.11 + testng 6.14 + appium 5.0.4 mvn dependencies.

  • 1
    Please edit your question to include your code, the HTML code of the app, any errors you are receiving or which lines of code are being skipped. Without that information, we don't have enough information to help you.
    – Kate Paulk
    Commented Apr 10, 2018 at 11:24

1 Answer 1


When something works in debug or manually what's typically happening is you've slowed down the test. When you switch views, you might not be waiting for an element on the new view before trying your other interactions. For Jr. devs I recommend using a Sleep/Pause to test this theory. If it works, replace it with an actual wait.

  • Thanks for your inputs, I tried that before posting, sorry for not being specific. I used Explicit wait and FluentWait. But that didn't help, I realized the issue was activity wasn't detected while it was in the foreground. So as a temporary fix I am pushing the app to background and bringing it to foreground in 5 seconds. Commented Apr 10, 2018 at 20:32

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.