Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

211
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda