Verify if clicking something get you out of the app in appium - android

I would like to know if it's possible to test that if I click on a element in my app (android or ios) it opens another app over mine
For example
If I click on a publicity does it goes out of the application and open a browser or not
If I click on a button to open another app does it goes correctly to the other one or to the store or not
etc

Yeah ! You can verify both points. Use String getCurrentActivity=driver.currentActivity(); if you know your second apps activities then directly verify activity against current one.

In general yes it is possible. Simply using Appium's inspector go throught your scenario:
If I click on a publicity does it goes out of the application and open a browser or not
And then check if Inspector found particular elements that you can base on in your tests - check if those web view has some id's, name or xpath.

pick an id from your app, after exiting your app check that id , if its present your in your app still, if its not present ,you have exited your app

Related

Is it possible for a Flutter for Android activity to NOT be fullscreen? Or have no UI at all?

I'm building a somewhat basic app (only testing on Android for now) with multiple lists, one of which is an Inbox list. I can share text from other apps to my app, and it works well.
However, I would like the app to handle the intent without launching the full app UI. For example, if I share a URL from the browser to my app, I would like it to be handled in the background, save the URL to Firestore, and show a toast to the user indicating that it was successful.
Ideally, I would like to put two entries in the share menu, one to add to the Inbox and show a toast as described above, and a second entry that gives the user a modal dialog that floats above the sharing-from app, which allows the user to choose a different list to save to.
I think I'll have to make a (for example) ShareActivity.java, and add it to AndroidManifest.xml, but I have no idea where to go after that, or even if that's the right approach.

How do I check the number of Activitys of a third party android application?

I want to check if WhatsApp creates separate activity for each conversation. I want to get an idea because I am creating a somewhat similar app.
(given that I am using a rooted device)
Most probably not . Why would they create separate activity for each conversation ?
But still if you want you can check in this chat app - Telegram , it's similar to whatsapp and it is open source-
Github repo

Using UiAutomator on drop down list

I'm exploring the UiAutomator capabilities on Android and I am trying to test it out along with the Google hangouts app. I've managed to go to the create new hangout page and enter a name, but I can't click on any of the drop down contacts as shown in the image below. I've tried searching by the package name com.google.android.talk and then using the instance() function, but I wasn't able to select the contacts. Is there anyway I could figure what the class name of that UI element would be? Or how else could I go about clicking that ui element?
You could try this tool:
/home/gabriel/android/android-sdk/tools/uiautomatorviewer
Use it to navigate through the application's views and layouts.

Defining URL for "put on homescreen" functionality

I'm working on a mobile webapplication which consists of multiple pages (with different urls)
/index.html
/products/1.html
/products/2.html
{...}
Now if the user is on one on the subpages and selects "put on homescreen", I'd like to put the startpage (i.e. /index.html) on the homescreen, so he goes to the home page when clicking on the icon instead of some subpage.
Is there any way to tell the mobile OS (iOS and Android in my case) which URL to choose for putting on the homescreen?
Unfortunately iOS chooses the current URL and does not provide a meta tag option to set this. As for Android I don't know whether there is a possibility to do this but I don't believe there is one. It makes sense for security reasons.
But maybe there is a workaround for this. I thought about the following (untested, just brainstorming):
Create a session for the user and measure last interaction time. If the last interaction happened e.g. 10 minutes ago, redirect the user to the starting page. So if your user doesn't use the App for a while and calls it via the homescreen, he will be redirected to the first page.
Another method would be to use anchors for all the navigation and a script that disallows to directly browse to anchors without previous user interaction. So even if your user is at /index.html#products/2 he has to start at index.html

If app is downloaded first time then registration comes from second time login comes

I am working on an app. The requirement is as: If the app is downloaded and opened first time 1) The Registration screen appears. 2) If user already has Registered, then he can skip this step3) and go to Login Screen. From second time onwards only login screen appears. 4) If app is downloaded and opened first time, Registration/Login screen appears. If user has already registered, he can simply login. From Second time onwards, direct to home page, no need to login. I am not getting any idea about this. Can some one please help me in this regard.Thanks
I suggest to use SharedPreferences to do this.
You need to learn how to use PreferenceManager, try reading here about storing data in your android app: Making data persistent in android

Categories

Resources