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

111
Vistas
How to retrieve the Request data from Post request that is triggered by Javascript

I am new to test Javascript. and the test is like this,

Load a page, then the Javascript is triggered, it fills the request payload data and then trigger the POST request with the generated payload data. My test need to validate the payload data are right. My problem is in the Chrome developer tool, I can see the POST request with Request Payload data. But I don't know how to get the Request payload data with any automation test tool or any other way.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It's pretty simple with something like Cypress.

You can view the docs how to setup Cypress: https://docs.cypress.io/guides/getting-started/installing-cypress

The test itself can be something like:

it('Should log the request body', () => {

  // start by intercepting the request
  cy.intercept('POST', '**/endpoint').as('interceptedRequest')

  // visit your url, and do some actions to trigger the request
  cy.visit('http://yoururl.com')

  // wait for your request to trigger
  cy.wait('@interceptedRequest')
    .its('request.body')
    .then((body) => {
      console.log(body)
    })
})
about 4 years ago · Juan Pablo Isaza Denunciar
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