Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!