Hi Team,
I’m working on automating an mobile web application in UiPath MDM. I have connected using browser stack for this. Here i need to get the URL of the current browser page, seems like there is no activity for Mobile Automation to get the URL of the browser in MDM. Anyone who has experienced this issue and can suggest how to resolve this ? Thanks
Hi @phaserescu, I tried using the method you suggested “GET [appiumUrl]/session/[session_id]/url” but faced with the below error message for the ‘Output Response Content’
Sets the authorization details (sauceLabsUsername and sauceLabsKey)
Constructs the API url
Makes a GET request to save the contexts (but it doesn’t use it because this is just a POC … normally you want to parse those and see if CHROMIUM is in there or sometimes explicit WEBVIEW.* contexts are in there)
Sets the context to CHROMIUM
Invokes Get Page Source to get the page source - instead of this you call the api for get url
Hi @phaserescu, i used the ‘Get Page’ source activity to get the page’s source and got the page URL from that. But here the issue is that it is difficult to get specified URL as the text file contains all the page source.
Can you explain on explicitly set a web context, so that i can use API to get URL of the page?
To get the available contexts you have the following API
GET [appiumUrl]/session/[session_id]/contexts
To get the current context
GET [appiumUrl]/session/[session_id]/context
Just for testing you can skip the parsing context part. Just see if you have CHROMIUM in the list of contexts (if you’re on Android, this is probably true). If not, look in the list for contexts starting with WebView.
And to set the context
POST [appiumUrl]/session/[session_id]/context
{"name": "CHROMIUM"}