WebdriverIO with Appium. Unable view contexts in App - android

I've worked with appium with webdriverIO in the past on a purely native app so I have never seen this issue before. I am trying to perform the following:
Given I am in the app
When I tap on the login button
And I am taken to the login screen
When I enter the email address
And password
Then I can view my logged in screen.
This should be a very simple scenario to test however, I was under the impression that the app was 100% native (android) however, I just found out in the last day or so that the app isn't and that to perform the above scenario I will have to switch context and I have to go into a browser and when I use use appium inspector to switch context, I get the following as you can see in this video I've sent to dev.
Has anyone else ever experienced this before and what did you do to fix it?
Also here's a screen shot

Related

Why the Facebook login popup opened on an external web browser app on my android device

Facebook login doesn't work on my android app.
I am using below Facebook SDK function.
LoginManager.getInstance().logInWithReadPermissions(activity, PERMISSIONS)
The web browser is opened and I faced the below screen by this upper line.
Sorry for Korean, the text means
You have previously logged into the X app with Facebook. Would you like to keep this right?
If I clicked continue/agree, there is nothing!
Just white screen...
But Actually, it works on another device!
I have two phones, and one works fine, but the other doesn't work!
The difference is web view.
Normal Case
The Facebook screen is opened on an internal web view.
Abnormal Case
The Facebook screen is opened on an external web browser app (Chrome)
I think that my app's callback is not called after the Facebook Login process.
Because it was processed on another app (Chrome).
If it was processed on an internal web view, it may work.
But I don't know how can I control it...
I'm using this on Kotlin its working fine but you have Facebook app already installed at your device
LoginManager.getInstance().loginBehavior = LoginBehavior.DIALOG_ONLY

Writing tests for an Android app that logs into Facebook

My Android app uses FacebookSDK for login. It's the first screen, and you can't do anything unless you login.
I want to write some Espresso tests to be ran on Greenhouse Continuous integration server.
I searched and I found FBSDKTestUsersManager on iOS, but nothing similar on Android.
What I plan to do is create a flavor of test and when that flavor is selected instead of a normal Facebook login button, I'd display a button that gets a test access token for the user, then brings them to the homepage of the app. However, I can't do that cause FBSDKTestUsersManager doesn't exist on Android.
Any suggestions?
The solution is to involve UIAutomator in your tests together with Espresso for Android. It will be possible to go outside of your app under test context and perform some actions on Facebook login dialog. Similar question here and the example in my blog post.

cannot click OK button in facebook login in android emulator

i'm working on an app in titanium studio that uses the facebook SSO to authenticate the user.
the odd issue we're having is that in the default android emulator, you can enter your username and password into the login overlay then you get to the confirm authorization page. fine, but you can't click OK or Cancel in the dialog, so the login never completes. the only click-able element on the page is the little (X) in the upper corner, which cancels the login. the console displays no errors at any time through this.
why this is strange: if i compile the app directly to my droid, it works perfectly. i can get logged in, look at my profile, whatever. i do not have the facebook app on my droid, but i installed it on the emulator thinking it might change the functioning. it didn't, it still won't let me click either button.
i realize that this is not a show-stopper type of bug, but it makes debugging via the emulator extremely problematic - so i was wondering if anyone else had run across/resolved this.
thanks!
as far as i can tell, the emulator doesn't play well with the login overlay from facebook: in addition to the click events not being heard, we also noticed later that some of the facebook button and image resources were not being loaded.
side note: in addition to the above facebook-related problems, we were also experiencing a failure to initialize the emulator or failure to install the apk to a running emulator, both for no apparent reason, roughly a 50% of the time.
solution: i gave up and switched our team to the genymotion emulator. it works perfectly every time. we haven't had a problem since.

Authenticating Dropbox leaves open Browser

I'm trying to have my App upload a file on Dropbox and I downloaded their DBRoulette test program but I found also there the strange behavior I'm now gonna explain
Basically once you push the button for authenticating the App and authorize it to link with your Dropbox there's a command the library provides which is
private DropboxAPI mApi;
mApi.getSession().startAuthentication(context);
Once this command is processed the native browser opens and shows the buttons Deny or Allow to accept or not the authorization, but the problem is that when you press it, the App comes back and shows itself while the native browser lies in the background, ready to appear again once you exit from the app and this is rather annoying (though it does it only the first time you launch the app)
p.s. before I forget I DO use in the onResume the following code which is suggested in the tutorial
session.finishAuthentication();
Thanks to anyone who will help me understand this problem better and (hopefully) solve it redirecting the authorization in a Webview OR closing the native browser once the button is pressed and the authentication is processed
Unfortunately, there is not much you can do about it.
The authentication process runs on the server-side, i.e. on Dropbox. That means that Dropbox defines the course of action for authenticating a user which you as the client have to follow. That's part of the idea of the OAuth authentication flow.
What I have experienced myself though is the fact that if you have the official Dropbox app installed, the app is used for authenticating the user (instead of the browser) and also gets closed after the user has pressed the allow/cancel button.

Android App Inventor: How do I set up a HTTPS connection?

I am making an app, with a very limited audience that logs into my mini website. It uses a HTTPS login dialog box though to access the site. How would I implement a setup where the user logs in with a username and password box on the first screen, submits the info with a button, which is used to log into the website, and then the user is taken to the next screen where there is a web viewer that is logged into and viewing the protected website.
This needs to be on Android and made in App Inventor, and I am quite clueless in programming, with little experience beyond hello world! :D I can string together some basic apps but here I am stumped. Please help! I just need some clear instruction really on what to do.
Though your question is nearly one year old, I pass you a solution in case you still require it. Like you I came accross the need of creating a login dialog in AppInventor and none of the solutions I found on the web met completely my idea so I decided to develop it on my own.
The solution can be used as a template for any new app and it provides the following functionalities:
Initial login window, with buttons allowing to register or remember password (by email)
User's information stored in a tinywebDB, with basic encryption for password
Integration with Google accounts, allowing the user to inform his google account instead of having to remember yet another password
Profile window, allowing the user to modify its setting after its registration
The sources are here. I've also created a tutorial on my website. And here is a real app using this template.

Categories

Resources