I am using Java Selenium for UI automation. Try to select checkbox in the shadow root but can not find the element.
<prod-checkbox class="class1" >
#shadow-root(open)
<label>
<input type="checkbox" name="" value="false">
<span class="checkmark"></span>
<span class="label">production_A</span>
</label>
</prod-checkbox>
<prod-checkbox class="class1" >
#shadow-root(open)
<label>
<input type="checkbox" name="" value="false">
<span class="checkmark"></span>
<span class="label">production_B</span>
</label>
</prod-checkbox>
These two checkboxes have the same className, the only difference is the label text. How can I access to specific one? Tried to do something like shadow.findElement(parent, cssSelector)
but not sure how to differentiate two checkboxes