I am trying to select multiple checkboxes. Here is my HTML
<div class="col-md-6">
<div class="form-sections">
<ul>
<li>Select permissions</li>
<li><input type="checkbox" id="permissions1549733530963" name="permissions"><label for="permissions1549733530963">Select all</label></li>
</ul>
<div class="searchbox-container">
<div class="check-list">
<ul>
<li><input type="checkbox" id="371549733530963" name="permissions" value="Add User"><label for="371549733530963">Add User</label></li>
<li><input type="checkbox" id="31549733530965" name="permissions" value="View User"><label for="31549733530965">View User</label></li>
</ul>
</div>
</div>
</div>
</div>
I want to select only two checkbox. I'm doing this:
driver.findElement(By.xpath("//input[@type='checkbox' && @name='permissions' && @value='"+value+'"")).click();
here id tag is generated randomly. How to select multiple checkboxes based on the value tag?