Whatsapp Web QR code Scanning using Appium Java

I have a company in-built web application that behaves similar to WhatsApp web. I need to link/scan using QR code of WhatsApp mobile application with company inbuilt web application using Appium with Java.

I hope the above info is clear but let me be more clear.

A is a web application that has a QR code to scan

B is the WhatsApp Mobile application

Now I need to automate that, using the B application I should scan the QR code showing on A application using Appium with Java .

Could someone help with some suggestions or examples would be a great favor, please?

Note: There is NO API information regarding QR code scanning in WhatsApp documentation and also a screenshot of the QR code option also doesn’t exist in WhatsApp linked device option which is causing trouble. There is documentation regarding APIs for WhatsApp business but not for normal WhatsApp.

Thanks in advance.

Only thing I’ve ever read about this kind of scenario is the zxing library. Here is a tutorial on implementing it, hope it helps:

https://medium.com/assertqualityassurance/read-a-qr-code-content-with-appium-and-zxing-cddc94221dc8

@wreed Thanks for going through this. I have already gone through the link you shared but that didn’t help much as automating the scanning from the normal WhatsApp mobile app is a bit difficult due to there is NO option in WhatsApp allowing to scan a screenshot QR code like WhatsApp contacts, only option is I need to use a real mobile device to scan the QR code so can’t use the screenshot functionality.

That’s a tough situation to be in. If it were me I would go to developers and explain the problems you are having with automation. Perhaps they could agree to some changes in the debug version of the app that would make this easier. Like a QR code that lasts long enough for you to use, or some default value that you can pass instead of using the QR code.

I would still do the manual testing on such a thing, but by changing the app to accommodate automation limitations, QA could qualify the app quickly. I often find developers are open to this line of thinking.

@wreed, thanks a lot for your suggestion but here the situation is really tough that I’m using normal WhatsApp mobile application so nothing to do with our developers as inbuilt company application is totally fine but its from the WhatsApp that didn’t left out any solutions to get on with the issue facing currently.

Anyway, Thanks again for your concern. Until then will do manually and think of any idea’s and also will wait for a solution or until WhatsApp gives me a handsfree source of related API’s to come up with a solution.