Automation for QR codes

How do you approach automation for features that include scanning of QR codes?

Do you have a set of test data QR codes? Is it something you don’t automate and instead need to physically test with real devices?

1 Like

I’d like to know too because I have never tested them. It seems simple to test with only automation, but I could be wrong.

Generate QR code images*** > Pass them to an API which consumes those images > Validate.

*** Images could be clear & perfect, different resolutions, low light, too much light, blurry, image too far/close, image at angle, different file formats, too large file size etc.

1 Like

I’d probably just hack it e.g. if the QR code scan opened a link, then I’d go straight to the link rather than worrying about the QR scan doing the correct thing.
Probably not worth the hassle of automating!

Be interested if anyone else has a different view.

2 Likes

This works for “properly” implemented QR codes, but the codes that the UK NHS App uses for example are “blobs”. So will depend on the QR code payload, how you test your app; but yours are clearly links, which are a great implementation and easier I assume to test them since you can use a generator.

Probably not worth automating either, pretty sure I saw a thread on twitter about this to be fair.

4 Likes