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

107
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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