mardi 23 octobre 2018

segmentio/nightmare click on div with data attribute

I use segmentio/nightmare for testing web. How to click on div with data-type="1"???

<div data-type="1" class="btnRate selected" title="1">1.07</div>

My code: const Nightmare = require('nightmare') const nightmare = Nightmare({ show: true })

function goToSite1(){
    nightmare

    .goto('https://page.local/')
    .click('.btnRate[data-type="1"]')
    .wait('#buttonSubmitId')
    .catch(error => {
        console.error('Tipsport failed:', error)
    })
}

Aucun commentaire:

Enregistrer un commentaire