nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.79k stars 1.31k forks source link

Checking inputs INSIDE labels are checked #1288

Closed naazy closed 7 years ago

naazy commented 7 years ago

It appears that selenium prevents inputs inside labels from being accessed by simple css selectors (e.g. in https://github.com/nightwatchjs/nightwatch/issues/362).

  <label class="form__checkbox-label" for="15-check1">
        <input class="form__checkbox data-multi-check"
                   type="checkbox"
                   value="check1"
                   name="15"
                   id="15-check1">
   </label>

I am trying to check that my checkbox #15-check1 is selected but the usual .verify.elementPresent('#15-check1:checked') is not working (even though I can see that the correct checkbox is selected) 😕

Note: I was unable to check the checkbox using the usual .click('#15-check1') and as per the advice in #362, I had to use .click('label[for="15-check1"]') instead

I do not have this problem with any other checkboxes (not inside labels).

Any help with this would be wonderful! Thanks 🙏

beatfactor commented 7 years ago

Please use the Mailing List or StackOverflow to ask for assistance. The GitHub Issues list is meant for submitting bugs and feature requests.