TestProject Forum

How to open a URL in Mobile

I am new to this TestProject.
I had an APP to be automated and I have created an Android test By adding the APK of the APP which I need to automate. Now as a part of automation I wanted to close the APP and I want to navigate to a URL in Browser.
So I have added these steps:
1.Close APP. (First I’m closing the APP which I’m currently in)
2.Click Android Keyboard search. (It is an Addon that I found in Actions and this directs me to the Mobile search page where I’m adding the URL which I want to use and it opens that page)
Screenshot 2021-03-03 161325

The issue here I’m facing is that, This Test works perfectly fine with my physical mobile device. But it fails when I try to run this Test over the Browserstack emulator. It fails at this step(Click Android Keyboard search.)

Can anyone help me with this issue or suggest some way where I can close the APP in which I’m testing then I need to open an URL and then want to go back to the APP which I have previously closed, And I wanted to run this test over the Browserstack emulators.

Thanks in advance.

Hello @srianoop.d
You can just switch between apps and do it.
For example, go to the Chrome app and enter a URL using Start Activity:
You need to enter the AppPackage and AppActivity for the application you want to switch to.

Enter the URL by recording the step so you can do so.
Let me know if it helped you

1 Like

Hey @kfiryo1
Thanks… it worked fine over emulators too.

One quick question @kfiryo1
I want to Run the similar test in iOS too… Is there a AppPackage for safari like for chrome in Android. Can you suggest the solution for that too if you have any ideas over that.

Thanks @kfiryo1 for the solution.

@srianoop.d Glad to hear it worked for you.
A similar for IOS is Launch App with Arguments/Env Variables action.
You need to add Bundle ID, for Safari it’s “com.apple.mobilesafari​”

For any other app, just search online.
You can see that in the Applications tab if you have uploaded the API file to your TP account.

1 Like

Thanks @kfiryo1 This helps a lot.