3

I am up to write Selenium+Appium test for Android app.

This app has activity with button. Tapping this button will open another activity above first one. So at this moment there will be 2 activities for application (I can see this if in Android Studio I will execute "Layout inspector" for my app, and Studio will ask me in "Select window" dialog which activity to use).

With apium I can work with first activity, but not with second. I can not find any element with any was (by id, by Xpath). Even tap on screen with TouchAction does not work on second activity. I tried dirrerent real devices and Emulators.

When I use driver.currentActivity() command, I will see that driver is using second activity.

But I have really no clue what to do and how fix this.

Hope you solved same problem and can help me.

Thank you.

mikamika
  • 110
  • 1
  • 6
  • i am not sure how you are writing your code. There is no problem in appium to move from one activity to another. you can inspect your app element by using **Appium inspector** or **UiautomatorViewer**. I prefer appium inspector as we can navigate to another activity by tap the button in it. – Suban Dhyako Jul 31 '18 at 07:42
  • 1
    This is not my application, but other programmer. He uses several Activities, which is working at same Monet, one above other. By user it looks like he simple moves between windows, but in reality app just pushes needed Activity to the front. And in this case driver can't interact with anything except very first activity. I tries to use Google UIAutomator, but it also fails in locating elements. – mikamika Aug 01 '18 at 09:47
  • If you can't find element's id or cont-Desc in uiautomator or appium desktop inspector, the you need to talk with your developer team and asked them to put id or automation id in their code. – Suban Dhyako Aug 08 '18 at 07:15
  • So, the problem seem to be still there, even if slightly different as I get the "first" activity in return from the driver.current_activities property. Using appium 1.22.3. – guandalf Nov 22 '22 at 15:47

0 Answers0