Very odd Visual UI Test Behavior

I am a new Kantu for Chrome user and started to take advantage of the Visual UI test capabilities.

This is probably just a newbie mistake on my part but I invite you to follow me along my journey into The Twilight Zone. You will either be entertained by my silliness or equally amazed at what I am experiencing.

  • First let’s see what works

I successfully playback the DemoVisualUITest

  • My First Test and Failure

I edit the first visualVerify command by reselecting the image on the page.
Clicking Find fails to return a result.

Here is a screenshot of the edit:

  • Now for the silly fix:

If I rename the auto generated filename with an _96 as in the demo files a Find is then successful.


  • Let’s extend the issue observed further:

When I rename the file used in DemoVisualUITest with an _144 to match the auto-generated naming Find is then unsuccessful.

  • Some additional observations:
  1. If I remove any dpi designation from the filename such as he01pd_dpi.png in this example, Find is successful.
  2. If I resample the image file to actually be 144 dpi then Find works with a filename of he01pd_dpi_144.png.
    An important note here is that using a filename of he01pd_dpi.png (removing the _144) results in Find being unsuccessful.
  • Jumping to conclusions:

It appears the default convention of Select returning a filename that includes dpi_144 will likely fail to return successful Find results. Renaming my selects with _dpi_96 or removing _dpi_144 seems to resolve the issue I am seeing.

It also suggests there is some measure of intelligence built into the naming scheme of image files. I have not found any documentation so far in my explorations.

I hope you have enjoyed your journey with me and would welcome any thoughts or guidance on what I am seeing.

1 Like

Yes, a very systematic and detailed travel report :smiley:

The number behind the dpi_ is the DPI of the screen. So on a normal screen it is 96 dpi, and on a HiDPI (high dpi) display it will be a larger value. Like on my current monitor, it is 120 dpi, and a typical auto-generated image file name looks like 8nCPRC_dpi_120.png

The reason for adding the dpi info is that with the DPI info the images are now portable, so images created on a HiDPI screen work on a different HiDPI screen and on a normal screen - without changing the image. Kantu automatically scales the image correctly.

But in your case it seems Kantu’s DPI detection get it wrong? So I assume you do not have a 144 dpi screen but a standard 96 dpi screen - that is why your “change to 96” fix works.

Is this assumption correct? And if so, do you have a Mac, Win or Linux?

(And yes, this info is missing from the docs, we will add it asap :wink: )

1 Like