jeudi 23 mars 2017

How to click on a checkbox with label using selenium node.js?

I have a html which has multiple checkbox classes each with different texts that is, each check box with a different name. This is the HTML,

<div class="col-md-12 syllabus-div-1">

<h4 class="vertical-spacing">Coaching<i class="fa fa-graduation-cap" aria-hidden="true" style="margin-left:5px; cursor:pointer" data-topic-url="/coach-topic-detail/41/"></i></h4>

<div class="checkbox">


<label><input type="checkbox" checked="" disabled="">Manage the Coaching Process<a href="http://ift.tt/2mTSSEG" target="_blank"><i class="fa fa-external-link" aria-hidden="true" style="margin-left:5px;"></i></a></label>
<p>Skipped on 03/16/2017</p>


</div>

<div class="checkbox">


<label><input type="checkbox" checked="" disabled="">Coaching Done Right<a href="http://ift.tt/2nG9AvS" target="_blank"><i class="fa fa-external-link" aria-hidden="true" style="margin-left:5px;"></i></a></label>
<p>Skipped on 03/16/2017</p>


</div>

<div class="checkbox">


<label><input type="checkbox" checked="" disabled="">Listen and Question Effectively<a href="http://ift.tt/2mTFcd1" target="_blank"><i class="fa fa-external-link" aria-hidden="true" style="margin-left:5px;"></i></a></label>
<p>Skipped on 03/16/2017</p>


</div>

<div class="checkbox">


<label><input type="checkbox" checked="" disabled="">Give Effective Feedback<a href="http://ift.tt/2nGgfX0" target="_blank"><i class="fa fa-external-link" aria-hidden="true" style="margin-left:5px;"></i></a></label>
<p>Skipped on 03/16/2017</p>


</div>

Using selenium(node.js) can I at a given point click on a checkbox by finding the element by name. For example, can i click on a check box by name Manage the Coaching Process, I have tried to find by LinkText. Is there anyway I can click on the checkbox by grabbing the text in the tag. Any help will be greatly Appreciated. TIA




Aucun commentaire:

Enregistrer un commentaire