Open mobile browser or calling api while running mobile app automation

Hello,
can Katalon support this scenario
i have an app with otp request,
also have an url to get otp code OR an api for calling get otp code
so can I open the app, request otp, then open the mobile browser (or calling api) to get code, then back to current session of app to input otp
thank you!
Tay

Hi @taynguyen,

Are you specifically getting your OTP from an email or API?

There is a lengthy discussion about how to get an OTP from a text notification in this thread:

There’s also a video here that might be helpful:

– Chris

yeah,
yes, i can get otp from api, once otp is generated it is also added on db too.
thank you so much, let me try then:stuck_out_tongue:

Hi @taynguyen,

You can mix in API calls to your mobile or web tests in Katalon. So at a high level, you could do the following:

  1. Create a Test Case that triggers an OTP in your project
  2. In the same project, create a new Web Service Request
  3. Fill in the info you would use to access the API - the URL, any parameters you would need, etc.
  4. In the Web Service Request, choose to add the request to an existing Test Case (choose the Test Case from above)

  1. You’ll see that a new line was added to your Test Case for the Web Service Request
  2. Add more testing steps to your Test Case that takes the result of the Web Service Request and fills in whatever mobile forms you have

Here are some docs on how to create an API call test in Katalon Studio:

https://docs.katalon.com/katalon-studio/docs/create_first_api_test_katalon_studio.html#katalon-new-features

And here are some docs on how to make the API calls manually:

https://docs.katalon.com/katalon-studio/docs/create_rest_api_requests_manually.html

Hope this helps,

Chris

Yeah, thank you,
Thank for your contribution too, :heart_eyes:
i got it, let me try then!

Hi Chris_Trevarthen,

Can you support me this scenario:
My app about capture face and driving license …, compares and put information…
I write test auto for this app, but in the screen “capture face”, after captured and press button complete, the app auto move to the result screen.
I want after step captured face before press button complete, can I call API with image be saved in the project instead of the captured image?

Many thanks!!!

Hi @VanVu,

To clarify, the app you’re testing is calling the API to upload the image directly - is that correct? You’re not uploading the image via a Katalon API test, is that correct as well?

In this case, you might have a few options to upload a specific image:

  1. Use a proxying tool, like Charles Proxy to rewrite the outgoing API call and replace the image with an existing one from your file system
  2. Build into the app a debug “switch” that pulls an image from the file system, and not the app’s camera
  3. Edit your test to overwrite the camera image file on the device before it sends it to the API (this is probably the most complicated, and I don’t know exactly how to do it at the moment, if it’s even possible).

Hope this helps,

Chris

Hi Chris,
Thank you for support to me, I will try it.
Could you support connect Genymotion into Katalon?

Many thanks!

@Chris_Trevarthen,

This is my scenario.
I am automating an app using the android mobile testing. But we have another app, which purely supporting web testing only.To run the mobile app, i have to create some preconditions in web application.
I have created a Katalon Mobile project and done my mobile app automation. I created a test case for my window application also inside the mobile project.

I created two suites in the same project ; one for my web application and other for mobile application.As a precondition, i have to run the Web application test suite first followed by mobile app test suite.Anyway i got my expected result. Just want to confirm that am i doing the correct way? is it right to mix two different application(web and mobile) in the same project?

Could you please add your valid suggestion?

Hi @Catch,

First, I’ll say that there isn’t really a correct way to structure a project. If you’re able to accomplish your goal, you can understand the project setup, and explain it to someone else, then that’s the criteria I would use to say it’s set up “correctly”. The only concern I see is if you start to get the Test Cases or Test Objects confused between web and mobile. A separate folder structure within your project might help avoid that.

If running your mobile test relies on the web test, then I think it makes sense to keep the tests in the same project at this point. That seems easier than having to open and close projects. Having the web and mobile tests in separate suites seems like a good way to isolate their execution and give you more control.

– Chris

Hi @VanVu,

Sorry I missed your question from January!

I’m not on of the Katalon developers, unfortunately, so adding any features to Katalon isn’t up to me. However, I think Katalon will support Genymotion if you launch the emulator first. At least, the way it works for me is to launch an emulator through Android Studio first, and then it will show up in Katalon Studio (Katalon won’t launch the Android emulator for you).

Hope this helps,

Chris

Thank you so much @Chris_Trevarthen for the reply