1

I have a problem with running Appium on my Android app. On release build, everything works fine. I'm able to run some basic test cases etc. The problem is when I switch from release to debug build. For debug, Appium is not able to open the app, there is a black screen and then error:

Exception in thread "main" org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters.
....

On emulator app is opened but this error still occurring with the same stack-trace (and again, release build works just fine)

I've tried already running my tests on different android versions (API 23, 24, 28) and results always the same.

I'm using AndroidDriver to find elements by id and click on them.

Is any reason why release builds works but debug not. Is there something I can do in order to run my tests on debug build?

Edit 1. My application is a Native Android app. I'm not able to open the debug app with the Appium desktop (I just see the Android home screen because Appium is not able to run the app).

According to differences between debug and release:

release build (exact opposite for the debug build):

  • debuggable disabled
  • minify enabled
  • shrink resources enabled
  • proguard enabled

Plus release build is signed

Kacper Opyrchał
  • 349
  • 3
  • 13
  • Can you provide information on your app? Is it a Hybrid or Native App? When using Appium Desktop, do you see same elements for a debug vs release build? – Nic Laforge Jun 02 '19 at 22:09
  • Please provide the full appium logs – Mani Jun 03 '19 at 02:43
  • @NicLaforge please see updated question – Kacper Opyrchał Jun 03 '19 at 06:42
  • How did you try to open the app using Appium Desktop? Since this is an Native App, I would assume Ids would be the same. Can you try to install the app, then open it with Appium using the packageName. – Nic Laforge Jun 03 '19 at 06:59
  • @NicLaforge I'm changing package name according to build, I'm pretty sure it's the valid one. If the package name would be invalid then I would not be able to even start the session – Kacper Opyrchał Jun 03 '19 at 07:18
  • I was more referring to installing the app prior (not with Appium). So it just hang and not error from appium? – Nic Laforge Jun 03 '19 at 07:24
  • @NicLaforge Yes, the app is not even launched (I'm able to see just Android home screen) – Kacper Opyrchał Jun 03 '19 at 09:13
  • From your first error, you are able to launch both using Appium Server? Could you run both and get the page source using driver.page_source. If you can provide sample that would help. – Nic Laforge Jun 03 '19 at 17:07

0 Answers0