Mobile Automation : Not able to Communicate with Browser Screen on Mobile App

Hi,

I am working on a Mobile Automation Project. I have uploaded the Mobile Application .apk file into BrowserStack, and i am able to access this application in UiPath Mobile Device Manager, but when that app launches any URL in Chrome, at that point I am not able to do any thing, not able to click on any button or text input.
When I click on any button in that mobile app browser window in the Mobile Device Manager, I get the following error message.

Could not access the provided web context. Ensure that the Android WebView is debuggable. More information can be found by going to Remote debugging WebViews - Chrome Developers .

Anyone who has experienced this issue and can suggest how to resolve this ? Thanks

Best Regards,
Raman

This is expected! Unless you start the session with a web app the webview context will not be debuggable (hybrid apps are supported though if the webview is set to debuggable from the app). Taking this into consideration, a work around is to start the session with a web app and then manually start your application. Hopefully when a link opens it will open in the chrome that has a debuggable webview and afterwards you can switch back and forth between your app and chrome using the Manage Other App activity.

  1. In the video I’m starting the session with a web app, and clicking around to show that is debuggable
  2. Then manually install my apk
  3. Using Manage Other App to start my App
  4. Click around
  5. Going back to Chrome
1 Like

Hi Cristian,

Thanks for your response. Actually I tried to connect physical device and tried to host app on local device using android studio, but could not make it work.

So, I found that with help of BrowserStack we can do that. I have uploaded the app on BrowserStack, and that app id i am passing in the Applications under Mobile Device Manager. Now when i start the connection, it directly launches that app, and then after i click on login in that app, it takes me to a Browser Screen.

Is there any dummy web app that I can launch on the same device? Can you please guide on how to launch a web app and switch to another app on the BrowserStack. Thanks a lot for your help.

Best Regards,
Raman

Raman, any web link will do. A “web app” is just a link and marked as a web app in the MDM (See the screenshot below).

1 Like

Thanks Cristian, I am able to launch the web application now, but when I am trying to give the actual app id which is on BrowserStack, ( the one I need to test )
It doesn’t open. Need your help to understand if this option will work for BrowserStack as well ? If you can guide on how to make it work, then it would be great. Thanks

The thing with BrowserStack appid is that it is something custom to them. What you need is to make your app available on a web server, so you can use “install app” and install it from there (I tested this and it works with browserstack).

You can test this using one of our own testing apps (eg. https://uipathtestappsto.blob.core.windows.net/testapps/BasicAppAndroid.apk)

1 Like

Thanks Cristian for help.
I am able to start with Web Browser, and then install the application using apk file.
Once application is started, I am able to click on Login which takes me to SSO page in chrome browser, once i enter details then and click on Login, it should bring me back to application, but somehow it is taking me back to Home Page of Phone.
Do we have to do any additional step in order to bring the control back to app from browser ? Thanks

Use manage other app activity to bring the app into view. That should work if the app didn’t crash.

Hi Cristian,

I tried Manage Other App Activity, but that didn’t help. So, I checked the logs in BrowserStack and it shows that page got crash after Bot clicks on Login button and control is expected to be back to App.
image
image

That app works fine if i test it using app live feature, so it doesn’t seem to be an issue with app.
But i am not sure if this is an issue with Browserstack or UiPath MDM.

Also, I was debugging the flow multiple times, so out of 10 times, it worked once when app didn’t crash, without any changes, kind of confusing. Thanks

It seems to be an incompatibility between the chromedriver used by Appium and the actual chrome version installed, but I’m not sure what you can do in this situation. If the Appium instance is run locally then there is an option to force the use of a custom chromedriver, but in this case I’m not sure if browserstack allows something similar.

One idea that comes to mind is to try the same but on an older device (say Samsung Galaxy S20) or on an emulator. That device might have an older Chrome that is compatible with Appium chromedriver.

Thanks Cristian for all the help.
I raised that issue to browserstack as well, they are looking into that in the backend.
Meanwhile, we tried with different devices and different new users, sometimes it works, sometimes it doesn’t, yet to identify the root cause of the issue.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.