schickling/chromeless

Cannot click on an element whereas document.querySelector().click works

Open

#221 aperta il 11 ago 2017

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)TypeScript (606 fork)batch import
help wantedquestion

Metriche repository

Star
 (13.240 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Hello

I try to expand a div by clicking on it but it doesn't expand.

If you go to https://www.perfectstay.com/fr-FR/bv-oly-hotel?uuid=test, you can expand the "Plus de détails"

Before expand : capture d ecran 2017-08-11 a 09 39 42

After expand : capture d ecran 2017-08-11 a 09 39 49

Using this code on the console do expand the div :

document.querySelector(".accommodation__introduction .more-details .rc-collapse-header").click()

However, using the chromeless click API does not expand the div. Here is my code runnable in the Playground

const chromeless = new Chromeless({ remote: true })
const screenshot = await chromeless
  .goto('https://www.perfectstay.com/fr-FR/bv-oly-hotel?uuid=test')
  .click(".accommodation__introduction .more-details .rc-collapse-header")
  .scrollTo(0, 2000)
  .screenshot()
console.log(screenshot)
await chromeless.end()

Thanks

Best regards !

Guida contributor