前言
单选框和复选框相关操作总结
locator.click() 点击操作
locator.check() 选中
locator.uncheck() 不选中
locator.set_checked() 设置选中状态
locator.is_checked() 判断是否被选中
使用场景
radio 和 checkbox 使用场景
<div>
<label>性别:
<input type="radio" name="sex" id="man" checked>男
<input type="radio" name="sex" id="woman">女
</label>
</div>
<div>
<label>标签:
<input type="checkbox" id="a1"> 旅游
<input type="checkbox" id="a2">看书
<input type="checkbox" id="a3" checked >