0

We need to add an image components verification where we need to verify CSS properties like font-size, font-family, position (x and y axis) etc. are matching with the benchmark data (Excel/JSON format).

We tried open screenshot in squish tool and tried to spy, but no option found to fetch its properties.

Is that possible to read screenshot (JPG/PNG) with either squish or some other tool and get its properties?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 1
    Are you actually asking if you can reverse engineer the CSS in use from a screenshot of the browser window? No. Not possible. If you have the browser window in front of you, you can Selenium to query the DOM and read exactly what was used. – Tim Roberts May 16 '23 at 05:21
  • Not exactly @TimRoberts, Using Squish we can spy (fetch CSS properties) components of an application by attaching application to it, but my scenario is after capturing screenshot by anyway, we just have jpg file in a directory, so can we mimic the same behavior what squish does (spying JPG file and fetch its component's CSS properties)? – Arunkumar G May 17 '23 at 06:42
  • 1
    Absolutely not. The JPG doesn't contain any "properties". It is nothing more than a dumb array of pixel colors. Squish uses operating system APIs to inspect the tree of window objects in the application, very similar to what Chrome does in its DOM view, because the underlying information is in that tree. – Tim Roberts May 17 '23 at 18:57

0 Answers0