Difficulty Getting OTP from Authenticator Chrome Extension

Hi there UIV Community, I was hoping you would be able to help me understand why something isn’t working.

I need to log into a website that has two factor authentication and I followed the UI.Vision “How to automate 2-factor logins with RPA” (How to automate 2-factor logins with RPA) how-to guide to achieve this.

For the longest time I could not get it working when I replaced the XClickRelative image with the screenshot of my own authenticator OTP entry. I tried setting the anchor text in a dozen different places/ways and found the correct DPI for the image so that I could include it in the file name. Nothing I did seemed to help resolve the problem. In the end I got it working by renaming my own OTP entry in the Authenticator extension to be “Namecheap”, which is what’s used in the how-to guide, and using the original “auth1_dpi_168_relative.png” image that is included in the downloadable example zip.

For weeks it has worked 100% of the time on my macbook. However, I need to run it on a Ubuntu desktop and since exporting the macro from my laptop and importing it to my desktop, the OCR can no longer find the OTP entry and 2FA fails. I haven’t changed anything in my macro and I’ve ensured that the Chrome/UI.Vision setup on my desktop is identical to my laptop but now I just get a “E601: Cannot find green and/or pink boxes” error. The step before it still works, i.e. the XClick on the Authenticator extension icon to open the window containing the OTP, but then the XClickRelative fails instantly. I’ve tried both the JS and XModule OCR packages and neither work. Is it something to do with DPI and screen resolution maybe?

Thank you in advance for any guidance or insight anyone can offer on the subject!

At the moment there is a known issue with desktop automation on Ubuntu 24, and you need the desktop automation mode to automate the authenticator :frowning:

→ One good workaround is to use the older Ubuntu 20.04.

Thanks so much for your quick response ulrich, that’s great to know. I’ll spin up a 20.04 instance now and test on there. Hopefully the issues with 24.04 will be fixed soon.

Thanks again for the info.

Hey @ulrich I’ve tried on Ubuntu 20.04 but also have the same problem.

I also realised that the desktop automation is actually working (even on 24.04) because the XClick to click on the Chrome extension icon to open the authenticator works fine and takes a screenshot no problem. The problem only occurs with the XClickRelative that is intended to copy the OTP from the window.

I’m not sure if this helps with diagnosis but it throws the “E601: Cannot find green and/or pink boxes” error instantly when it gets to that step. No 10s timeout or anything. I tried putting a pause of a few seconds before it just in case but it didn’t make any difference. Same behaviour on both Ubuntu 24.04 and 20.04.

Thank you in advance!

Hey @ulrich just a heads up that I was able to solve the problem for both Ubuntu 20.04 and 24.04 using the method suggested in this post - OCRExtractRelative not finding green and pink boxes - #5 by GerardN

It seems that the shades of green and pink are still a problem on Ubuntu (note, the image file I was using is still the one from the “Namecheap” how-to downloadable zip. I didn’t alter it in any way. It worked fine in Chrome on Mac, but Chrome on Ubuntu doesn’t like the shade). Like the post above suggested, I opened the RPA image editor, re-drew the green and pink boxes but instead of saving it I took a screenshot of the image in the editor. Gave it a dpi_168_relative name and it works fine again.

Thanks again for your help.