Scan QR code using emulator/real device

Mobile Testing, Android App Testing.
dhiman0842
Posts: 1
Joined: Wed Mar 17, 2021 2:22 am

Scan QR code using emulator/real device

Post by dhiman0842 » Wed Mar 17, 2021 2:44 am

Hi,

For a POC, I need to automate an use case in which I need to scan a QR code, steps are something like:
1. Launch the native app
2. Click on the scan (barcode icon) button
3. Provide a QR code image to the scanner (device camera) from emulator/device gallery to emulate the behavior of real user
4. Verify the redirection based on the QR code

I already researched on how to decode the QR code, but still not able to figure out how to provide image to the scan functionality.

Thanks

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Scan QR code using emulator/real device

Post by odklizec » Fri Apr 09, 2021 10:40 am

Hi,

If by "launching native app" you mean Android/iOS native app (not your own and instrumented app), then I'm afraid, you are out of luck here. Due to security restrictions in iOS and Android, it's not possible to automate system (non-instrumented) apps. It's definitely not possible on iOS. You may have certain luck with Android apps, because there is an option in Ranorex, to automate Android OS apps. But even with this option enabled, you should not expect entirely reliable automation of Android native apps.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

RobertZacchia
Posts: 4
Joined: Tue Jul 20, 2021 2:06 pm

Re: Scan QR code using emulator/real device

Post by RobertZacchia » Tue Sep 14, 2021 12:14 pm

Hi,

What if the AUT needs to scan a bar/QR scan, could this be automated with a stored picture?
We are thinking of expanding Ranorex use for our mobile devices, but it would not make much sense if this is not possible.

Thanks