1

What is the difference between visible:false and hidden:true for page.waitForSelector

I read puppeteer page.waitForSelector documentation and PR 967

I am not able to understand their usecases as well as most importantly difference between them.

await page.waitForSelector(selector, {visible:false});

and

await page.waitForSelector(selector, {hidden:true});

Can someone please put some light on it and explain with real life scenarios?

Govinda
  • 582
  • 1
  • 5
  • 14
  • These CSS attributes do not exactly do the same: https://stackoverflow.com/questions/133051/what-is-the-difference-between-visibilityhidden-and-displaynone – Pit Sep 02 '19 at 11:10

1 Answers1

1

The options have simply a reverse boolean logic:

hidden: true

display: none or visibility: hidden CSS

visible: false

display: none or visibility: hidden CSS

Ref: https://github.com/GoogleChrome/puppeteer/blob/v1.19.0/docs/api.md#framewaitfornavigationoptions

Mosè Raguzzini
  • 15,399
  • 1
  • 31
  • 43