Appium test on Android app which is developed using IONIC


#1

I have created an Android application using Ionic. I was able to tap/check or do anything in the SIGN IN page. Everything works fine in SIGN IN page. But when I move from SIGN IN Page for eg: Feedback page, Am not able Tap any buttons, invoke any TextFields in the Feedback page.

Even I used the Appium inspector to tap on the Buttons/Textfields, its of no use. Tried even after restarting the Appium, even the PC. I wonder why its not even working on the Appium inspector. I never faced this issue in a native app.

  1. Why I was not able click any items in the second screen i.e Feedback page
  2. In HTML file I have added ID for all the items, but am not able to see them in the Appium Inspector. Am I missing something here?

Or is it a problem with Ionic apps. Let me know


#2

In HTML file I have added ID for all the items, do u means to say feedback page is a webview and not a native page?


#3

The entire app is a Hybrid app, i.e HTML. All these HTML are loaded in the WebView. I have added ID for buttons and Textfields in HTML. Am not able to see the same in the Appium inspector.


#4

You cannot inspect webview inside Appium Inspector / UIAutomatorviewer

You can use chrome remote debugger for this

for coding you can try this link


#5

Thanks for the Link BTW. Just to confirm that you are saying that I need to change the logic/code to Automate Appium for Hybrid apps ?


#6

You don’t have to change any business/programming Logic, just we need to follow the procedure to handle webview during automation and procedure is very simple

get webview debugger enabled app
find different context using getContext() method
Wait and switch to web view context using its name displayed by above api using setContext() method
Now throw automation commands just like selenium and it will work


#7

Thanks @amitjaincoer191 for your clarification. But i have clarification wont the webview testing deceives the purpose of android app testing i.e the actulal behaviour of the app wont be tested realisticlly, is there any other alternative way to automate this kind of hybrid app.
I facing a similar issue i am unable to sendkeys for a ionic framework build android app.


#8

Make sure that you are using web driver wait for every element.
Also since its hybrid app and you are switching between different pages, e.g. Login Page, Landing Page etc. try to use switch to window method. Every page will be a separate window and once you navigate from one page to another you need to use switch to window functionality.
I was having similar kind of issues when I started to use Appium with hybrid apps but was able to over come by provided suggestions.


#9

@Umair_Sabzwari
Thanks mate, I was not switching the window and later on i figured out.
Didn’t got a chance to look into it.
Anyway thanks for the help.


#10

I have issue with Swipe in ionic Android app which to be says hybrid app.

but when i use WebView - it throw an error message method is not available - which is expected.
Nativeview - Touchaction won’t throw any error, but don’t perform any task on mobile

Looking for support for Swiping functionality on ionic mobile app.