Am a novice selenium programmer please help me with this...
I have below html and am trying to count the child nodes of element <div class="result-controls">
which is 4 (1 div
and 3 li
elements)
<div class="result-controls">
<div class="attachment">
<li class="add-attachment-button-column"><a><button>ADD ATTACHMENTS</button></a></li><input type="file" multiple="" style="display: none;">
</div>
<li class="sign-button-column"><a href="javascript:void(0)"><button>SIGN</button></a></li>
<li class="draft-button-column"><a><button>DRAFT</button></a></li>
<li class="delete-column"> <a href="javascript:void(0)"><svg class="glyphicon-trash" viewBox="0 0 100 100"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#trash"></use></svg> </a></li>
</div>
currently am calculating the count separately as below (row
variable has above html)
li_actions_count = row.find_elements(:xpath => "./li").length
div_actions_count = row.find_elements(:xpath => "./div").length
can anyone help me with a simple way to do this in Ruby using selenium web driver