Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

208
Vistas
App that converts image to base64 string displays different results on browser's console when run in headed and headless mode. Does anyone know why?

I'm using Playwright to write an automated test for a Node.js app. The app has a test web page with a button that allows to manually select an image, which will then be processed and converted to a base64 string, which will be logged on the browser's console for verification. The automated test I'm writing simulates the manual actions and then compares the base64 string logged in the console with another one saved on a file.

The image is decoded to base64 by the FileReader class, with the readAsDataURL() method (documentation here), as shown on the snippet below:

            reader.onload = () => {
                EXIF.getData(file, () => {
                    const imageBase64 = reader.result

                    // more code here
                })
            }

            reader.readAsDataURL(file)

The issue I'm facing is that when the test is run with a Chrome headed browser, the base64 is different than when it is run with a Chrome headless browser, even though the image is the same. Does anyone know why?

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda