Mobile Automation - Not able to go 'Back' in browser

Hi,
I’m working on automating an mobile web application in UiPath MDM. I have connected using browser stack for this. Here the issue is, when i try to go back to the previous page in the browser using ‘Tap’ activity (To tap on mobile ‘Back’ icon) or by using ‘Press Hardware Button’ activity, the page jumps to browser homepage instead of previous page. Is there any other work around to navigate to the previous page of the browser. Anyone who has experienced this issue and can suggest how to resolve this ? Thanks

Best Regards,
Kamal

Hi @Kamal_Haris

You can use navigate to activity in UiPath and provide the link of previous page to move to it.

Hi Sonali, I think it is not available for UiPath.MobileAutomation.Activities, if it’s in UiAutomation activites, we cannot use it. And also as the previous page URL is not static we cannot pass it directly. Please help me in this. Thanks.

@Kamal_Haris

How do you navigate through this manually?

By pressing back button or some other way?

For Mobile Automation there is the Open URL activity!

I’ve also tested the Press Hardware Button activity with the Back button and it works as intended. If I was on a page and then go to another, and then press the Back button it goes back to the previous page.

1 Like

During manual process, we could navigate either by tapping the ‘Back’ icon of the mobile or by swiping gestures

Hi Cristian,

During manual execution the page is navigated correctly to the previous page, but when the process is running in automation, the page navigation is directed to the browser’s homepage. I have used both the Press Hardware Button activity and also the Tap activity. Same case for both activity.

I cannot use Open URL activity here, as the URL of the page is not static and also we cannot use UiPath.UiAutomation activites while using UiPath.MobileAutomation.Activities package.

Only solution is to go ‘Browser Back’. Is there any other way for this? Thanks.

There is one more option: to actually do a browser back action via Appium.

You have to do a POST HTTP call to the following endpoint

POST /wd/hub/session/:session_id/back

In order to do this you need the current session id that you can get using Get Session Identifier activitiy.

You can do the call using the HTTP Request activity.

Later edit: I did a quick project to show this:
project.zip (3.4 KB)

  1. I’m using saucelabs so I construct the url using the sauce labs url but you can take the url from the device connection as well.
  2. When the workflow is started it opens a browser with ArsTechnica
  3. Then I use OpenUrl to open YCombinator
  4. Then I POST to the endpoint to go back, and you can notice that the browser executes the back action.

Can we use the same method for ‘Browserstack’ as i have connect the MDM via Browserstack?. Seems like BrowserStack does not provide a public HTTP API for /back like Sauce Labs. Thanks.

yes! most likely you’re not constructing the url right. When you setup the device to browserstack you provide an url for appium (let’s call it appiumUrl). The right endpoint for back is appiumUrl/session/session_id_that_you_got_back_from_get_session_identifier/back.

Awesome @phaserescu !!!
I used this Appium endpoint URL appiumUrl/session/session_id_from_get_session_identifier/back in my workflow and its is navigating correctly to the previous page.

Thanks Christian, its working like a charm. Really appreciate your help man.

1 Like

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