0
我試圖簽入RadioButtonList的值:如何用量角器選擇radiobuttonlist中的值?
<ul id="rbgHomeOccupier" class="radio-group cols-6">
<li class="radio-group-button">
<input type="radio" id="homeOccupierInjuredYes" class="radio-group-input" value="true"
tabindex="" name="homeOccupierInjured" ng-model="claim.damage.homeOccupierInjured" required>
<label for="homeOccupierInjuredYes" class="radio-group-label">Yes</label>
</li>
<li class="radio-group-button">
<input type="radio" id="homeOccupierInjuredNo" class="radio-group-input" value="false" tabindex=""
name="homeOccupierInjured"
ng-model="claim.damage.homeOccupierInjured" required>
<label for="homeOccupierInjuredNo" class="radio-group-label">No</label>
</li>
</ul>
這是我的嘗試:
element.all(by.id('rbgHomeOccupier')).get(1).click();
不過,我得到一個錯誤說那裏只有一個元素是:
Failed: Index out of bound. Trying to access element at index: 1, but there are only 1 elements that match locator By.id("rbgHomeOccupier")
如何選擇第一個值,即'是'?