Appium for Android with multiple Fragments


#1

I am using Appium for automating my Android app. I have a fragment to enter email and after verifying that second fragment with password field will be loaded. I am able to find all elements in the first fragment; but elements in the second fragment can’t be found using any of the methods like By, PageFactory + @AndroidFindBy. Can someone provide a help to sort this issue?


#2

Can you post a screenshot of Appium desktop hierarchy tree of the second fragment?


#4

If I use single fragments inside activities it works fine. But it doesn’t work if we have multiple fragments inside an activity and we try to find elements inside those fragments.
I saw lot of tickets created asking about the support for fragments. (some are added below)


Is there any official note on this?Whether appium supports multiple fragments or not?


#5

I am automating an native Android App.
On login screen i am able to find elements and when it move from login screen to home screen on this screen selenium not able to find the element.
I did research on this and i found this is happening due to fragment so can anyone help on this?

 My Test Class Code:-

ScreenLocator Class from where i wrote locator:-


#6

Screenshot of uiAutomatorViewer


#7

I am getting NoSuchElement exception when clickOnSideBarIcon() gets called.
@PoornimaSuraj do you how to handle this