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

169
Visualizações
Change element value in nightwatchjs

As part of my nightwatchjs test script, I would like to change the value of an element on the page in order to stop a pop-up from appearing on a subsequent page.

The html is as below;

div id="newsletterSignup" class="newsletter-signup" data-page-view-threshold="3" style="display: block;"

So in this instance, on the 3rd visited page, the Newsletter popup would appear.

However, I don't want this popup to appear, so my idea was to change the data-page-view-threshold="3" value from 3 to 50.

This way, my test script would finish before 50 pages were visited and the popup would not be displayed.

However, when I tried using the getValue command in Nightwatch on the element #newsletterSignup[data-page-view-threshold], it returned the value as null.

Hence, using setValue command didn't work, as the current setting of 3 doesn't seem to be an actual value.

Is there more complicated that I was hoping, or am I missing something obvious somewhere?

Any help in this would be greatly appreciated.

about 4 years ago · Juan Pablo Isaza
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